| java.lang.Object org.bouncycastle.mail.smime.SMIMEGenerator org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator
SMIMEEnvelopedGenerator | public class SMIMEEnvelopedGenerator extends SMIMEGenerator (Code) | | General class for generating a pkcs7-mime message.
A simple example of usage.
SMIMEEnvelopedGenerator fact = new SMIMEEnvelopedGenerator();
fact.addKeyTransRecipient(cert);
MimeBodyPart smime = fact.generate(content, algorithm, "BC");
Note: Most clients expect the MimeBodyPart to be in a MimeMultipart
when it's sent.
|
Method Summary | |
public void | addKEKRecipient(SecretKey key, byte[] keyIdentifier) add a KEK recipient. | public void | addKeyAgreementRecipient(String agreementAlgorithm, PrivateKey senderPrivateKey, PublicKey senderPublicKey, X509Certificate recipientCert, String cekWrapAlgorithm, String provider) Add a key agreement based recipient. | public void | addKeyTransRecipient(X509Certificate cert) add a recipient. | public void | addKeyTransRecipient(PublicKey key, byte[] subKeyId) add a recipient - note: this will only work on V3 and later clients. | public MimeBodyPart | generate(MimeBodyPart content, String encryptionOID, String provider) generate an enveloped object that contains an SMIME Enveloped
object using the given provider. | public MimeBodyPart | generate(MimeMessage message, String encryptionOID, String provider) | public MimeBodyPart | generate(MimeBodyPart content, String encryptionOID, int keySize, String provider) generate an enveloped object that contains an SMIME Enveloped
object using the given provider. | public MimeBodyPart | generate(MimeMessage message, String encryptionOID, int keySize, String provider) generate an enveloped object that contains an SMIME Enveloped
object using the given provider from the contents of the passed in
message. | public void | setBerEncodeRecipients(boolean berEncodeRecipientSet) |
CAMELLIA128_CBC | final public static String CAMELLIA128_CBC(Code) | | |
CAMELLIA128_WRAP | final public static String CAMELLIA128_WRAP(Code) | | |
CAMELLIA192_CBC | final public static String CAMELLIA192_CBC(Code) | | |
CAMELLIA192_WRAP | final public static String CAMELLIA192_WRAP(Code) | | |
CAMELLIA256_CBC | final public static String CAMELLIA256_CBC(Code) | | |
CAMELLIA256_WRAP | final public static String CAMELLIA256_WRAP(Code) | | |
SMIMEEnvelopedGenerator | public SMIMEEnvelopedGenerator()(Code) | | base constructor
|
addKeyAgreementRecipient | public void addKeyAgreementRecipient(String agreementAlgorithm, PrivateKey senderPrivateKey, PublicKey senderPublicKey, X509Certificate recipientCert, String cekWrapAlgorithm, String provider) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException(Code) | | Add a key agreement based recipient.
Parameters: senderPrivateKey - private key to initialise sender side of agreement with. Parameters: senderPublicKey - sender public key to include with message. Parameters: recipientCert - recipient's public key certificate. Parameters: cekWrapAlgorithm - OID for key wrapping algorithm to use. Parameters: provider - provider to use for the agreement calculation. |
addKeyTransRecipient | public void addKeyTransRecipient(PublicKey key, byte[] subKeyId) throws IllegalArgumentException(Code) | | add a recipient - note: this will only work on V3 and later clients.
Parameters: key - the recipient's public key Parameters: subKeyId - the subject key id for the recipient's public key |
generate | public MimeBodyPart generate(MimeMessage message, String encryptionOID, int keySize, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, SMIMEException(Code) | | generate an enveloped object that contains an SMIME Enveloped
object using the given provider from the contents of the passed in
message. The size of the encryption key used to protect the message
is determined by keysize.
|
setBerEncodeRecipients | public void setBerEncodeRecipients(boolean berEncodeRecipientSet)(Code) | | Use a BER Set to store the recipient information
|
|
|