iaik.smime
Class SMimeSignerInfo

java.lang.Object
  extended by iaik.cms.SignerInfo
      extended by iaik.smime.SMimeSignerInfo
All Implemented Interfaces:
ASN1Type

public class SMimeSignerInfo
extends SignerInfo

Extends SignerInfo to use a set of S/MIME standard attributes.

When using this class to create a SignerInfo for a S/MIME message, automatically some standard attributes are added to the set of signed attributes. Depending on the constructor used for creating the SignerInfo, the following attributes are set:

Note that the MessageDigest attribute will not be set by the constructor. It will be later calculated from the digest value computet from the content data.


Constructor Summary
SMimeSignerInfo()
          Default constructor.
SMimeSignerInfo(X509Certificate signerCert, AlgorithmID digestAlgorithm, AlgorithmID signatureAlgorithm, java.security.PrivateKey privateKey)
          Creates a new SignerInfo from given signerIdentifier, and digestAlgorithm ID, signature algorithmID, and the signer private key.
SMimeSignerInfo(X509Certificate signerCert, AlgorithmID digestAlgorithm, AlgorithmID signatureAlgorithm, java.security.PrivateKey privateKey, X509Certificate encryptionCertOfSigner, boolean includeEncryptionCertIDForMSOE)
          Creates a new SignerInfo from given signerIdentifier, and digestAlgorithm ID, signature algorithmID, and the signer private key.
SMimeSignerInfo(X509Certificate signerCert, AlgorithmID digestAlgorithm, java.security.PrivateKey privateKey)
          Creates a new SignerInfo from given SignerIdentifier, digestAlgorithm ID, and the signer private key.
 
Method Summary
 
Methods inherited from class iaik.cms.SignerInfo
addSignedAttribute, addSignedAttributes, addUnsignedAttribute, addUnSignedAttribute, addUnsignedAttributes, decode, getCMSVersion, getDigest, getDigestAlgorithm, getSecurityProvider, getSignatureAlgorithm, getSignatureValue, getSignedAttribute, getSignedAttributes, getSignedAttributes, getSignedAttributeValue, getSignedAttrs, getSignedDigest, getSignerId, getSignerIdentifier, getSigningCertificateAttribute, getSigningCertificateV2Attribute, getSigValue, getUnsignedAttribute, getUnsignedAttributes, getUnsignedAttributes, getUnsignedAttributeValue, getVersion, isSignerCertificate, removeSignedAttribute, removeUnsignedAttribute, removeUnSignedAttribute, setEncryptedDigest, setSecurityProvider, setSignatureValue, setSignedAttributes, setUnsignedAttributes, toASN1Object, toString, toString, verifySignature, verifySignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMimeSignerInfo

public SMimeSignerInfo()
                throws SMimeException
Default constructor. Creates an empty SignerInfo object and sets the version number to 1, and the signature algorithm ID to rsaEncryption. The following attributes are set a signed attributes:

Throws:
SMimeException - if an error occurs when creating/setting the attributes

SMimeSignerInfo

public SMimeSignerInfo(X509Certificate signerCert,
                       AlgorithmID digestAlgorithm,
                       java.security.PrivateKey privateKey)
                throws SMimeException
Creates a new SignerInfo from given SignerIdentifier, digestAlgorithm ID, and the signer private key.

The signerIdentifier identifies the signer certificate either by issuer distinguished name and issuer-specific serial number or by SubjectKeyIdentifier. The digestAlgorithm ID specifies the message digest algorithm used for calculating the digest of the content and any signed information. The private key is used for calculating the signature. When using this constructor, the signature is calculated with the PKCS#1 rsaEncryption method. The following attributes are set a signed attributes:

Parameters:
signerCert - the certificate of the signer
digestAlgorithm - the algorithm to be used for message digest calculation
privateKey - the signer private key to be used for signing
Throws:
SMimeException - if an error occurs when creating/setting the attributes

SMimeSignerInfo

public SMimeSignerInfo(X509Certificate signerCert,
                       AlgorithmID digestAlgorithm,
                       AlgorithmID signatureAlgorithm,
                       java.security.PrivateKey privateKey)
                throws SMimeException
Creates a new SignerInfo from given signerIdentifier, and digestAlgorithm ID, signature algorithmID, and the signer private key.

The signerIdentifier identifies the signer certificate either by issuer distinguished name and issuer-specific serial number or by SubjectKeyIdentifier. The digestAlgorithm ID specifies the message digest algorithm used for calculating the digest of the content and any signed information. The private key is used for calculating the signature with the given signature algorithm. The following attributes are set a signed attributes:

Parameters:
signerCert - the certificate of the signer
digestAlgorithm - the algorithm to be used for message digest calculation
signatureAlgorithm - the algorithm to be used for signature calculation
privateKey - the signer private key to be used for signing
Throws:
SMimeException - if an error occurs when creating/setting the attributes

SMimeSignerInfo

public SMimeSignerInfo(X509Certificate signerCert,
                       AlgorithmID digestAlgorithm,
                       AlgorithmID signatureAlgorithm,
                       java.security.PrivateKey privateKey,
                       X509Certificate encryptionCertOfSigner,
                       boolean includeEncryptionCertIDForMSOE)
                throws SMimeException
Creates a new SignerInfo from given signerIdentifier, and digestAlgorithm ID, signature algorithmID, and the signer private key.

The signerIdentifier identifies the signer certificate either by issuer distinguished name and issuer-specific serial number or by SubjectKeyIdentifier. The digestAlgorithm ID specifies the message digest algorithm used for calculating the digest of the content and any signed information. The private key is used for calculating the signature with the given signature algorithm. The following attributes are set a signed attributes:

Parameters:
signerCert - the certificate of the signer
digestAlgorithm - the algorithm to be used for message digest calculation
signatureAlgorithm - the algorithm to be used for signature calculation
privateKey - the signer private key to be used for signing
encryptionCertOfSigner - the encryption cert of the signer; if not null, the SMIMEEncryptionKeyPreference attribute will be included into the SignerInfo
includeEncryptionCertIDForMSOE - if true and the encryption cert of the signer 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
Throws:
SMimeException - if an error occurs when creating/setting the attributes

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC