public class SmimeUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_Cert_HASH_ALG |
| Constructor and Description |
|---|
SmimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
canonicalize(MimePart mp)
Applies MIME content canonicalization, recursively, to the given
MimePart. |
static javax.activation.FileDataSource |
createFileDataSource(java.io.File file,
java.lang.String contentTypeHeader)
Creates an instance of
javax.activation.FileDataSource. |
static javax.activation.FileDataSource |
createFileDataSource(java.lang.String name,
java.lang.String contentTypeHeader)
Creates an instance of
javax.activation.FileDataSource. |
static byte[] |
toBytes(MimeBodyPart bodyPart)
Convert a MimeBodyPart to a byte array.
|
static byte[] |
toBytes(MimeBodyPart bodyPart,
int length)
Convert a MimeBodyPart to a byte array.
|
static void |
updateHeaders(MimeBodyPart bodyPart)
Deprecated.
|
public static final java.lang.String DEFAULT_Cert_HASH_ALG
public static void updateHeaders(MimeBodyPart bodyPart)
throws MessagingException
MessagingExceptionpublic static byte[] toBytes(MimeBodyPart bodyPart)
throws MessagingException,
java.io.IOException
bodyPart - The content.MessagingException - An error occurred while canonicalizing the content.java.io.IOException - An I/O error occurred.public static byte[] toBytes(MimeBodyPart bodyPart,
int length)
throws MessagingException,
java.io.IOException
bodyPart - The content.length - The content Length.MessagingException - An error occurred while canonicalizing the content.java.io.IOException - An I/O error occurred.public static javax.activation.FileDataSource createFileDataSource(java.io.File file,
java.lang.String contentTypeHeader)
javax.activation.FileDataSource.
Use this method rather than directly instantiating a FileDataSource
if transparent handling of multipart or multipart/signed S/MIME types is desired.
(The default FileDataSource included with JAF 1.0.1 does not handle
multipart MIME boundaries when used with Javamail 1.1.3.)
file - The file from which to create this data source.contentTypeHeader - The content type MIME header string (may be null).FileDataSource.public static javax.activation.FileDataSource createFileDataSource(java.lang.String name,
java.lang.String contentTypeHeader)
javax.activation.FileDataSource.
Use this method rather than directly instantiating a FileDataSource
if transparent handling of multipart or multipart/signed S/MIME types is desired.
(The default FileDataSource included with JAF 1.0.1 does not handle
multipart MIME boundaries when used with Javamail 1.1.3.)
name - The name of the file from which to create this data source.contentTypeHeader - The content type MIME header string (may be null).FileDataSource.public static void canonicalize(MimePart mp)
throws MessagingException
MimePart. Currently canonicalizes only content with
top-level content type of "text".MessagingException