public class SMIMEEnvelopedGenerator extends SMIMEGenerator
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 | Field and Description |
---|---|
static String |
AES128_CBC |
static String |
AES128_WRAP |
static String |
AES192_CBC |
static String |
AES256_CBC |
static String |
AES256_WRAP |
static String |
CAMELLIA128_CBC |
static String |
CAMELLIA128_WRAP |
static String |
CAMELLIA192_CBC |
static String |
CAMELLIA192_WRAP |
static String |
CAMELLIA256_CBC |
static String |
CAMELLIA256_WRAP |
static String |
CAST5_CBC |
static String |
DES_EDE3_CBC |
static String |
DES_EDE3_WRAP |
static String |
ECDH_SHA1KDF |
static String |
IDEA_CBC |
static String |
RC2_CBC |
static String |
SEED_CBC |
static String |
SEED_WRAP |
encoding, useBase64
Constructor and Description |
---|
SMIMEEnvelopedGenerator()
base constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addRecipientInfoGenerator(RecipientInfoGenerator recipientInfoGen)
add a recipientInfoGenerator.
|
javax.mail.internet.MimeBodyPart |
generate(javax.mail.internet.MimeBodyPart content,
OutputEncryptor encryptor)
generate an enveloped object that contains an SMIME Enveloped
object using the given content encryptor
|
javax.mail.internet.MimeBodyPart |
generate(javax.mail.internet.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
|
void |
setBerEncodeRecipients(boolean berEncodeRecipientSet)
Use a BER Set to store the recipient information
|
createSymmetricKeyGenerator, makeContentBodyPart, makeContentBodyPart, setContentTransferEncoding
public static final String DES_EDE3_CBC
public static final String RC2_CBC
public static final String IDEA_CBC
public static final String CAST5_CBC
public static final String AES128_CBC
public static final String AES192_CBC
public static final String AES256_CBC
public static final String CAMELLIA128_CBC
public static final String CAMELLIA192_CBC
public static final String CAMELLIA256_CBC
public static final String SEED_CBC
public static final String DES_EDE3_WRAP
public static final String AES128_WRAP
public static final String AES256_WRAP
public static final String CAMELLIA128_WRAP
public static final String CAMELLIA192_WRAP
public static final String CAMELLIA256_WRAP
public static final String SEED_WRAP
public static final String ECDH_SHA1KDF
public void addRecipientInfoGenerator(RecipientInfoGenerator recipientInfoGen) throws IllegalArgumentException
IllegalArgumentException
public void setBerEncodeRecipients(boolean berEncodeRecipientSet)
public javax.mail.internet.MimeBodyPart generate(javax.mail.internet.MimeBodyPart content, OutputEncryptor encryptor) throws SMIMEException
SMIMEException
public javax.mail.internet.MimeBodyPart generate(javax.mail.internet.MimeMessage message, OutputEncryptor encryptor) throws SMIMEException
SMIMEException
Copyright © 2018 BouncyCastle.org. All rights reserved.