|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.smime.SMimeUtil
public class SMimeUtil
This class provides some utilties.
Method Summary | |
---|---|
static Attribute[] |
createStandardAttributes()
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attribute[] |
createStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attribute[] |
createStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attribute[] |
createStandardAttributes(X509Certificate[] signerCerts,
AlgorithmID hashAlg,
CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static java.lang.String[] |
getEmailAddresses(X509Certificate certificate)
Gets all email adresses that are included in the given certificate. |
static SMIMECapabilities |
makeSMIMECapabilitiesAttribute()
Creates an SMIMECapabilities attribute for AES-256-CBC, AES-128-CBC, DES-EDE-CBC, RC2-CBC (128, 64, 40 bit keylength) and DES-CBC. |
static Attributes |
makeStandardAttributes()
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attributes |
makeStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attributes |
makeStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static Attributes |
makeStandardAttributes(X509Certificate[] signerCerts,
AlgorithmID hashAlg,
CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Attribute[] createStandardAttributes() throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method makeStandardAttributes
but returns the attributes as array.
SMimeException
- if an error occurs when creating/setting the attributespublic static Attribute[] createStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method makeStandardAttributes
but returns the attributes as array.
encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryption
SMimeException
- if an error occurs when creating/setting the attributespublic static Attribute[] createStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, ObjectID contentType) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method makeStandardAttributes
but returns the attributes as array.
encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryptioncontentType
- the contentType for the ContentType attribute
SMimeException
- if an error occurs when creating/setting the attributespublic static Attribute[] createStandardAttributes(X509Certificate[] signerCerts, AlgorithmID hashAlg, CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, ObjectID contentType) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
signerCerts
is not
null
and not empty
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method makeStandardAttributes
but returns the attributes as array.
signerCerts
- the (ordered) certificate chain of the signer if the
SigningCertificate/SigningCertificateV2 attribute shall be includedhashAlg
- the hash algorithm for the SigningCertificate/SigningCertificateV2
attribute (default: SHA-1)encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryptioncontentType
- the contentType for the ContentType attribute
SMimeException
- if an error occurs when creating/setting the attributespublic static Attributes makeStandardAttributes() throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method createStandardAttributes
but returns the attributes as iaik.asn1.structures.Attributes
object.
SMimeException
- if an error occurs when creating/setting the attributespublic static Attributes makeStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method createStandardAttributes
but returns the attributes as iaik.asn1.structures.Attributes
object.
encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryption
SMimeException
- if an error occurs when creating/setting the attributespublic static Attributes makeStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, ObjectID contentType) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method createStandardAttributes
but returns the attributes as iaik.asn1.structures.Attributes
object.
encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryptioncontentType
- the contentType for the ContentType attribute
SMimeException
- if an error occurs when creating/setting the attributespublic static Attributes makeStandardAttributes(X509Certificate[] signerCerts, AlgorithmID hashAlg, CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, ObjectID contentType) throws SMimeException
This method sets the following attributes for the supplied SignerInfo:
encryptionCertID
is not null
encryptionCertID
is not null
and
includeEncryptionCertIDForMSOE
is true
(this attribute is required by MSOE to recognize the encryption certificate if
different certs are used for signing and encryption
signerCerts
is not
null
and not empty
SignerInfo
thereby letting class SignerInfo calculating the message digest value
as required.
Note that this method does exactly the same as method createStandardAttributes
but returns the attributes as iaik.asn1.structures.Attributes
object.
signerCerts
- the (ordered) certificate chain of the signer if the
SigningCertificate/SigningCertificateV2 attribute shall be includedhashAlg
- the hash algorithm for the SigningCertificate/SigningCertificateV2
attribute (default: SHA-1)encryptionCertID
- an ID for the encryption cert of the signer; if
not null, the SMIMEEncryptionKeyPreference attribute
will be included into the SignerInfoincludeEncryptionCertIDForMSOE
- if true
and an
encryptionCertID of type IssuerAndSerialNumber is provided,
a private MS attribute will be included allowing MSOE to recognize
the encryption cert of the signer if using different certs for
signing/encryptioncontentType
- the contentType for the ContentType attribute
SMimeException
- if an error occurs when creating/setting the attributespublic static SMIMECapabilities makeSMIMECapabilitiesAttribute()
public static java.lang.String[] getEmailAddresses(X509Certificate certificate)
certificate
- the certificate for which to get its email addresses
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |