SMIMEEnvelopedGenerator fact = new SMIMEEnvelopedGenerator();
fact.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCert).setProvider("BC"));
MimeBodyPart mp = fact.generate(content, new JceCMSContentEncryptorBuilder(CMSAlgorithm.RC2_CBC, 40).setProvider("BC").build());
Note
Most clients expect the MimeBodyPart to be in a MimeMultipart when it's sent.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | |
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| pack-priv static final String | |
| private SMIMEEnvelopedGenerator. | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public MimeBodyPart | generate(MimeBodyPart content, OutputEncryptor encryptor)
generate an enveloped object that contains an SMIME Enveloped object using the given content encryptor |
| public MimeBodyPart | generate(MimeMessage message, OutputEncryptor encryptor)
generate an enveloped object that contains an SMIME Enveloped object using the given provider from the contents of the passed in message |
| protected SMIMEStreamingProcessor | |
| protected String | |
| private MimeBodyPart | make(MimeBodyPart content, OutputEncryptor encryptor)
if we get here we expect the Mime body part to be well defined. |
| public void | setBerEncodeRecipients(boolean berEncodeRecipientSet)
Use a BER Set to store the recipient information |
| AES128_CBC | back to summary |
|---|---|
| public static final String AES128_CBC | |
| AES128_WRAP | back to summary |
|---|---|
| public static final String AES128_WRAP | |
| AES192_CBC | back to summary |
|---|---|
| public static final String AES192_CBC | |
| AES256_CBC | back to summary |
|---|---|
| public static final String AES256_CBC | |
| AES256_WRAP | back to summary |
|---|---|
| public static final String AES256_WRAP | |
| CAMELLIA128_CBC | back to summary |
|---|---|
| public static final String CAMELLIA128_CBC | |
| CAMELLIA128_WRAP | back to summary |
|---|---|
| public static final String CAMELLIA128_WRAP | |
| CAMELLIA192_CBC | back to summary |
|---|---|
| public static final String CAMELLIA192_CBC | |
| CAMELLIA192_WRAP | back to summary |
|---|---|
| public static final String CAMELLIA192_WRAP | |
| CAMELLIA256_CBC | back to summary |
|---|---|
| public static final String CAMELLIA256_CBC | |
| CAMELLIA256_WRAP | back to summary |
|---|---|
| public static final String CAMELLIA256_WRAP | |
| CAST5_CBC | back to summary |
|---|---|
| public static final String CAST5_CBC | |
| DES_EDE3_CBC | back to summary |
|---|---|
| public static final String DES_EDE3_CBC | |
| DES_EDE3_WRAP | back to summary |
|---|---|
| public static final String DES_EDE3_WRAP | |
| ECDH_SHA1KDF | back to summary |
|---|---|
| public static final String ECDH_SHA1KDF | |
| ENVELOPED_DATA_CONTENT_TYPE | back to summary |
|---|---|
| pack-priv static final String ENVELOPED_DATA_CONTENT_TYPE | |
| fact | back to summary |
|---|---|
| private SMIMEEnvelopedGenerator. | |
| IDEA_CBC | back to summary |
|---|---|
| public static final String IDEA_CBC | |
| RC2_CBC | back to summary |
|---|---|
| public static final String RC2_CBC | |
| SEED_CBC | back to summary |
|---|---|
| public static final String SEED_CBC | |
| SEED_WRAP | back to summary |
|---|---|
| public static final String SEED_WRAP | |
| SMIMEEnvelopedGenerator | back to summary |
|---|---|
| public SMIMEEnvelopedGenerator() base constructor | |
| addRecipientInfoGenerator | back to summary |
|---|---|
| public void addRecipientInfoGenerator(RecipientInfoGenerator recipientInfoGen) throws IllegalArgumentException add a recipientInfoGenerator. | |
| generate | back to summary |
|---|---|
| public MimeBodyPart generate(MimeBodyPart content, OutputEncryptor encryptor) throws SMIMEException generate an enveloped object that contains an SMIME Enveloped object using the given content encryptor | |
| generate | back to summary |
|---|---|
| public MimeBodyPart generate(MimeMessage message, OutputEncryptor encryptor) throws SMIMEException generate an enveloped object that contains an SMIME Enveloped object using the given provider from the contents of the passed in message | |
| getContentEncryptor | back to summary |
|---|---|
| protected SMIMEStreamingProcessor getContentEncryptor(MimeBodyPart content, OutputEncryptor encryptor) throws SMIMEException return content encryptor. | |
| getEncryptedContentType | back to summary |
|---|---|
| protected String getEncryptedContentType() return encrypted content type for enveloped data. | |
| make | back to summary |
|---|---|
| private MimeBodyPart make(MimeBodyPart content, OutputEncryptor encryptor) throws SMIMEException if we get here we expect the Mime body part to be well defined. | |
| setBerEncodeRecipients | back to summary |
|---|---|
| public void setBerEncodeRecipients(boolean berEncodeRecipientSet) Use a BER Set to store the recipient information | |
| Modifier and Type | Field and Description |
|---|---|
| private final MimeBodyPart | |
| private OutputEncryptor | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| _content | back to summary |
|---|---|
| private final MimeBodyPart _content | |
| _encryptor | back to summary |
|---|---|
| private OutputEncryptor _encryptor | |
| _firstTime | back to summary |
|---|---|
| private boolean _firstTime | |
| ContentEncryptor | back to summary |
|---|---|
| pack-priv ContentEncryptor(MimeBodyPart content, OutputEncryptor encryptor) | |
| write | back to summary |
|---|---|
| public void write(OutputStream out) throws IOException Implements org. | |
| Modifier and Type | Field and Description |
|---|---|
| private ASN1ObjectIdentifier | |
| private ASN1EncodableVector |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected OutputStream | open(ASN1ObjectIdentifier dataType, OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor)
Overrides org.
|
| pack-priv OutputStream |
| dataType | back to summary |
|---|---|
| private ASN1ObjectIdentifier dataType | |
| recipientInfos | back to summary |
|---|---|
| private ASN1EncodableVector recipientInfos | |
| EnvelopedGenerator | back to summary |
|---|---|
| private EnvelopedGenerator() | |
| open | back to summary |
|---|---|
| protected OutputStream open(ASN1ObjectIdentifier dataType, OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor) throws IOException Overrides org. | |
| regenerate | back to summary |
|---|---|
| pack-priv OutputStream regenerate(OutputStream out, OutputEncryptor encryptor) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private Throwable |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Throwable | getCause()
Overrides java. Returns the cause of this throwable or |
| cause | back to summary |
|---|---|
| private Throwable cause Hides java. | |
| WrappingIOException | back to summary |
|---|---|
| pack-priv WrappingIOException(String msg, Throwable cause) | |
| getCause | back to summary |
|---|---|
| public Throwable getCause() Overrides java. Doc from java. Returns the cause of this throwable or This implementation returns the cause that was supplied via one of
the constructors requiring a
| |