Class SMIMEAuthEnvelopedGenerator
java.lang.Object
org.bouncycastle.mail.smime.SMIMEGenerator
org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator
org.bouncycastle.mail.smime.SMIMEAuthEnvelopedGenerator
General class for generating a pkcs7-mime message using AEAD algorithm.
A simple example of usage.
SMIMEAuthEnvelopedGenerator fact = new SMIMEAuthEnvelopedGenerator();
fact.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCert).setProvider("BC"));
MimeBodyPart mp = fact.generate(content, new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES256_GCM).setProvider("BC").build());
Note: Most clients expect the MimeBodyPart to be in a MimeMultipart
when it's sent.-
Nested Class Summary
Nested classes/interfaces inherited from class SMIMEEnvelopedGenerator
SMIMEEnvelopedGenerator.WrappingIOException -
Field Summary
FieldsFields inherited from class SMIMEEnvelopedGenerator
AES128_CBC, AES128_WRAP, AES192_CBC, AES256_CBC, AES256_WRAP, CAMELLIA128_CBC, CAMELLIA128_WRAP, CAMELLIA192_CBC, CAMELLIA192_WRAP, CAMELLIA256_CBC, CAMELLIA256_WRAP, CAST5_CBC, DES_EDE3_CBC, DES_EDE3_WRAP, ECDH_SHA1KDF, IDEA_CBC, RC2_CBC, SEED_CBC, SEED_WRAPFields inherited from class SMIMEGenerator
encoding, useBase64 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecipientInfoGenerator(org.bouncycastle.cms.RecipientInfoGenerator recipientInfoGen) add a recipientInfoGenerator.protected SMIMEStreamingProcessorgetContentEncryptor(javax.mail.internet.MimeBodyPart content, org.bouncycastle.operator.OutputEncryptor encryptor) return content encryptor.protected Stringreturn encrypted content type for enveloped data.voidsetBerEncodeRecipients(boolean berEncodeRecipientSet) Use a BER Set to store the recipient informationMethods inherited from class SMIMEEnvelopedGenerator
generate, generateMethods inherited from class SMIMEGenerator
makeContentBodyPart, makeContentBodyPart, setContentTransferEncoding
-
Field Details
-
AES128_GCM
-
AES192_GCM
-
AES256_GCM
-
-
Constructor Details
-
SMIMEAuthEnvelopedGenerator
public SMIMEAuthEnvelopedGenerator()base constructor
-
-
Method Details
-
addRecipientInfoGenerator
public void addRecipientInfoGenerator(org.bouncycastle.cms.RecipientInfoGenerator recipientInfoGen) throws IllegalArgumentException add a recipientInfoGenerator.- Overrides:
addRecipientInfoGeneratorin classSMIMEEnvelopedGenerator- Throws:
IllegalArgumentException
-
setBerEncodeRecipients
public void setBerEncodeRecipients(boolean berEncodeRecipientSet) Use a BER Set to store the recipient information- Overrides:
setBerEncodeRecipientsin classSMIMEEnvelopedGenerator
-
getEncryptedContentType
return encrypted content type for enveloped data.- Overrides:
getEncryptedContentTypein classSMIMEEnvelopedGenerator
-
getContentEncryptor
protected SMIMEStreamingProcessor getContentEncryptor(javax.mail.internet.MimeBodyPart content, org.bouncycastle.operator.OutputEncryptor encryptor) throws SMIMEException return content encryptor.- Overrides:
getContentEncryptorin classSMIMEEnvelopedGenerator- Throws:
SMIMEException
-