|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiaik.smime.SMimeUtil
public class SMimeUtil
This class provides some utilties.
Method Summary | |
---|---|
static iaik.asn1.structures.Attribute[] |
createStandardAttributes()
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attribute[] |
createStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attribute[] |
createStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
iaik.asn1.ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attribute[] |
createStandardAttributes(iaik.x509.X509Certificate[] signerCerts,
iaik.asn1.structures.AlgorithmID hashAlg,
CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
iaik.asn1.ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static java.lang.String[] |
getEmailAddresses(iaik.x509.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 iaik.asn1.structures.Attributes |
makeStandardAttributes()
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attributes |
makeStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attributes |
makeStandardAttributes(CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
iaik.asn1.ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static iaik.asn1.structures.Attributes |
makeStandardAttributes(iaik.x509.X509Certificate[] signerCerts,
iaik.asn1.structures.AlgorithmID hashAlg,
CertificateIdentifier encryptionCertID,
boolean includeEncryptionCertIDForMSOE,
iaik.asn1.ObjectID contentType)
Creates a set of standard attributes to may be included into the signedAttributes field of a SignerInfo. |
static void |
setSession(javax.mail.Session session)
Sets the Session object to be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setSession(javax.mail.Session session)
The Session object set by this method will be used internally by the library whenever a Session object is required. If not set, a default Session object with "mail.smtp.host" "mailhost" will be used.
session
- the Session objectpublic static iaik.asn1.structures.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 iaik.asn1.structures.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 iaik.asn1.structures.Attribute[] createStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, iaik.asn1.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 iaik.asn1.structures.Attribute[] createStandardAttributes(iaik.x509.X509Certificate[] signerCerts, iaik.asn1.structures.AlgorithmID hashAlg, CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, iaik.asn1.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 iaik.asn1.structures.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 iaik.asn1.structures.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 iaik.asn1.structures.Attributes makeStandardAttributes(CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, iaik.asn1.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 iaik.asn1.structures.Attributes makeStandardAttributes(iaik.x509.X509Certificate[] signerCerts, iaik.asn1.structures.AlgorithmID hashAlg, CertificateIdentifier encryptionCertID, boolean includeEncryptionCertIDForMSOE, iaik.asn1.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(iaik.x509.X509Certificate certificate)
certificate
- the certificate for which to get its email addresses
|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
![]() |