| java.lang.Object org.bouncycastle.mail.smime.SMIMEGenerator org.bouncycastle.mail.smime.SMIMESignedGenerator
SMIMESignedGenerator | public class SMIMESignedGenerator extends SMIMEGenerator (Code) | | general class for generating a pkcs7-signature message.
A simple example of usage.
CertStore certs...
SMIMESignedGenerator fact = new SMIMESignedGenerator();
fact.addSigner(privKey, cert, SMIMESignedGenerator.DIGEST_SHA1);
fact.addCertificatesAndCRLs(certs);
MimeMultipart smime = fact.generate(content, "BC");
Note: if you are using this class with AS2 or some other protocol
that does not use "7bit" as the default content transfer encoding you
will need to use the constructor that allows you to specify the default
content transfer encoding, such as "binary".
|
Method Summary | |
public void | addAttributeCertificates(X509Store store) Add the attribute certificates contained in the passed in store to the
generator. | public void | addCertificatesAndCRLs(CertStore certStore) add the certificates and CRLs contained in the given CertStore
to the pool that will be included in the encoded signature block. | public void | addSigner(PrivateKey key, X509Certificate cert, String digestOID) add a signer - no attributes other than the default ones will be
provided here. | public void | addSigner(PrivateKey key, X509Certificate cert, String digestOID, AttributeTable signedAttr, AttributeTable unsignedAttr) Add a signer with extra signed/unsigned attributes or overrides
for the standard attributes. | public MimeMultipart | generate(MimeBodyPart content, String sigProvider) generate a signed object that contains an SMIME Signed Multipart
object using the given provider.
Parameters: content - the MimeBodyPart to be signed. Parameters: sigProvider - the provider to be used for the signature. | public MimeMultipart | generate(MimeMessage message, String sigProvider) | public MimeBodyPart | generateCertificateManagement(String provider) Creates a certificate management message which is like a signed message with no content
or signers but that still carries certificates and CRLs. | public MimeBodyPart | generateEncapsulated(MimeBodyPart content, String sigProvider) generate a signed message with encapsulated content
Note: doing this is strongly not recommended as it means a
recipient of the message will have to be able to read the signature to read the
message. | public MimeBodyPart | generateEncapsulated(MimeMessage message, String sigProvider) generate a signed object that contains an SMIME Signed Multipart
object using the given provider from the given MimeMessage. | public Map | getGeneratedDigests() Return a map of oids and byte arrays representing the digests calculated on the content during
the last generate. |
DIGEST_GOST3411 | final public static String DIGEST_GOST3411(Code) | | |
DIGEST_RIPEMD128 | final public static String DIGEST_RIPEMD128(Code) | | |
DIGEST_RIPEMD160 | final public static String DIGEST_RIPEMD160(Code) | | |
DIGEST_RIPEMD256 | final public static String DIGEST_RIPEMD256(Code) | | |
ENCRYPTION_DSA | final public static String ENCRYPTION_DSA(Code) | | |
ENCRYPTION_ECDSA | final public static String ENCRYPTION_ECDSA(Code) | | |
ENCRYPTION_ECGOST3410 | final public static String ENCRYPTION_ECGOST3410(Code) | | |
ENCRYPTION_GOST3410 | final public static String ENCRYPTION_GOST3410(Code) | | |
ENCRYPTION_RSA | final public static String ENCRYPTION_RSA(Code) | | |
ENCRYPTION_RSA_PSS | final public static String ENCRYPTION_RSA_PSS(Code) | | |
SMIMESignedGenerator | public SMIMESignedGenerator()(Code) | | base constructor - default content transfer encoding 7bit
|
SMIMESignedGenerator | public SMIMESignedGenerator(String defaultContentTransferEncoding)(Code) | | base constructor - default content transfer encoding explicitly set
Parameters: defaultContentTransferEncoding - new default to use. |
addAttributeCertificates | public void addAttributeCertificates(X509Store store) throws CMSException(Code) | | Add the attribute certificates contained in the passed in store to the
generator.
Parameters: store - a store of Version 2 attribute certificates throws: CMSException - if an error occurse processing the store. |
addCertificatesAndCRLs | public void addCertificatesAndCRLs(CertStore certStore) throws CertStoreException, SMIMEException(Code) | | add the certificates and CRLs contained in the given CertStore
to the pool that will be included in the encoded signature block.
Note: this assumes the CertStore will support null in the get
methods.
Parameters: certStore - CertStore containing the certificates and CRLs to be added. |
addSigner | public void addSigner(PrivateKey key, X509Certificate cert, String digestOID) throws IllegalArgumentException(Code) | | add a signer - no attributes other than the default ones will be
provided here.
Parameters: key - key to use to generate the signature Parameters: cert - the public key certificate associated with the signer's key. Parameters: digestOID - object ID of the digest algorithm to use. exception: IllegalArgumentException - any of the arguments are inappropriate |
addSigner | public void addSigner(PrivateKey key, X509Certificate cert, String digestOID, AttributeTable signedAttr, AttributeTable unsignedAttr) throws IllegalArgumentException(Code) | | Add a signer with extra signed/unsigned attributes or overrides
for the standard attributes. For example this method can be used to
explictly set default attributes such as the signing time.
Parameters: key - key to use to generate the signature Parameters: cert - the public key certificate associated with the signer's key. Parameters: digestOID - object ID of the digest algorithm to use. Parameters: signedAttr - signed attributes to be included in the signature. Parameters: unsignedAttr - unsigned attribitues to be included. exception: IllegalArgumentException - any of the arguments are inappropriate |
generateCertificateManagement | public MimeBodyPart generateCertificateManagement(String provider) throws SMIMEException, NoSuchProviderException(Code) | | Creates a certificate management message which is like a signed message with no content
or signers but that still carries certificates and CRLs.
a MimeBodyPart containing the certs and CRLs. |
generateEncapsulated | public MimeBodyPart generateEncapsulated(MimeBodyPart content, String sigProvider) throws NoSuchAlgorithmException, NoSuchProviderException, SMIMEException(Code) | | generate a signed message with encapsulated content
Note: doing this is strongly not recommended as it means a
recipient of the message will have to be able to read the signature to read the
message.
|
generateEncapsulated | public MimeBodyPart generateEncapsulated(MimeMessage message, String sigProvider) throws NoSuchAlgorithmException, NoSuchProviderException, SMIMEException(Code) | | generate a signed object that contains an SMIME Signed Multipart
object using the given provider from the given MimeMessage.
Note: doing this is strongly not recommended as it means a
recipient of the message will have to be able to read the signature to read the
message.
|
getGeneratedDigests | public Map getGeneratedDigests()(Code) | | Return a map of oids and byte arrays representing the digests calculated on the content during
the last generate.
a map of oids (as String objects) and byte[] representing digests. |
|
|