Top Description Inners Fields Constructors Methods
org.bouncycastle.mail.smime

public Class SMIMEAuthEnvelopedGenerator

extends SMIMEEnvelopedGenerator
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.security.AccessController, .PrivilegedAction, javax.activation.CommandMap, .MailcapCommandMap, javax.mail.MessagingException, javax.mail.internet.MimeBodyPart, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1ObjectIdentifier, org.bouncycastle.cms.CMSAuthEnvelopedDataGenerator, .CMSAuthEnvelopedDataStreamGenerator, .CMSException, .RecipientInfoGenerator, org.bouncycastle.operator.OutputAEADEncryptor, .OutputEncryptor

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 and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
pack-priv static final String
private final SMIMEAuthEnvelopedGenerator.AuthEnvelopedGenerator
Inherited from org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator:
AES128_CBCAES128_WRAPAES192_CBCAES256_CBCAES256_WRAPCAMELLIA128_CBCCAMELLIA128_WRAPCAMELLIA192_CBCCAMELLIA192_WRAPCAMELLIA256_CBCCAMELLIA256_WRAPCAST5_CBCDES_EDE3_CBCDES_EDE3_WRAPECDH_SHA1KDFENVELOPED_DATA_CONTENT_TYPEIDEA_CBCRC2_CBCSEED_CBCSEED_WRAP

Constructor Summary

AccessConstructor and Description
public
SMIMEAuthEnvelopedGenerator()

base constructor

Method Summary

Modifier and TypeMethod and Description
public void
protected SMIMEStreamingProcessor
protected String
public void
setBerEncodeRecipients(boolean berEncodeRecipientSet)

Overrides org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator.setBerEncodeRecipients.

Use a BER Set to store the recipient information

Inherited from org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator:
generategenerate

Field Detail

AES128_GCMback to summary
public static final String AES128_GCM
AES192_GCMback to summary
public static final String AES192_GCM
AES256_GCMback to summary
public static final String AES256_GCM
AUTH_ENVELOPED_DATA_CONTENT_TYPEback to summary
pack-priv static final String AUTH_ENVELOPED_DATA_CONTENT_TYPE
authFactback to summary
private final SMIMEAuthEnvelopedGenerator.AuthEnvelopedGenerator authFact

Constructor Detail

SMIMEAuthEnvelopedGeneratorback to summary
public SMIMEAuthEnvelopedGenerator()

base constructor

Method Detail

addRecipientInfoGeneratorback to summary
public void addRecipientInfoGenerator(RecipientInfoGenerator recipientInfoGen) throws IllegalArgumentException

Overrides org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator.addRecipientInfoGenerator.

add a recipientInfoGenerator.

getContentEncryptorback to summary
protected SMIMEStreamingProcessor getContentEncryptor(MimeBodyPart content, OutputEncryptor encryptor) throws SMIMEException

Overrides org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator.getContentEncryptor.

return content encryptor.

getEncryptedContentTypeback to summary
protected String getEncryptedContentType()

Overrides org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator.getEncryptedContentType.

return encrypted content type for enveloped data.

setBerEncodeRecipientsback to summary
public void setBerEncodeRecipients(boolean berEncodeRecipientSet)

Overrides org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator.setBerEncodeRecipients.

Use a BER Set to store the recipient information

org.bouncycastle.mail.smime back to summary

private Class SMIMEAuthEnvelopedGenerator.AuthEnvelopedGenerator

extends CMSAuthEnvelopedDataStreamGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ASN1ObjectIdentifier
private ASN1EncodableVector

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected OutputStream
pack-priv OutputStream
Inherited from org.bouncycastle.cms.CMSAuthEnvelopedDataStreamGenerator:
openopensetBEREncodeRecipientssetBufferSize

Field Detail

dataTypeback to summary
private ASN1ObjectIdentifier dataType
recipientInfosback to summary
private ASN1EncodableVector recipientInfos

Constructor Detail

AuthEnvelopedGeneratorback to summary
private AuthEnvelopedGenerator()

Method Detail

openback to summary
protected OutputStream open(ASN1ObjectIdentifier dataType, OutputStream out, ASN1EncodableVector recipientInfos, OutputAEADEncryptor encryptor) throws IOException

Overrides org.bouncycastle.cms.CMSAuthEnvelopedDataStreamGenerator.open.

regenerateback to summary
pack-priv OutputStream regenerate(OutputStream out, OutputAEADEncryptor encryptor) throws IOException
org.bouncycastle.mail.smime back to summary

private Class SMIMEAuthEnvelopedGenerator.ContentEncryptor

extends Object
implements SMIMEStreamingProcessor
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.mail.smime.SMIMEAuthEnvelopedGenerator.ContentEncryptor
All Implemented Interfaces
org.bouncycastle.mail.smime.SMIMEStreamingProcessor

Field Summary

Modifier and TypeField and Description
private final MimeBodyPart
private OutputAEADEncryptor
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_contentback to summary
private final MimeBodyPart _content
_encryptorback to summary
private OutputAEADEncryptor _encryptor
_firstTimeback to summary
private boolean _firstTime

Constructor Detail

ContentEncryptorback to summary
pack-priv ContentEncryptor(MimeBodyPart content, OutputAEADEncryptor encryptor)

Method Detail

writeback to summary
public void write(OutputStream out) throws IOException

Implements org.bouncycastle.mail.smime.SMIMEStreamingProcessor.write.