Class SMIMEEnvelopedGenerator

java.lang.Object
org.bouncycastle.mail.smime.SMIMEGenerator
org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator

public class SMIMEEnvelopedGenerator extends SMIMEGenerator
General class for generating a pkcs7-mime message. A simple example of usage.
      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.
  • Field Details Link icon

    • DES_EDE3_CBC Link icon

      public static final String DES_EDE3_CBC
    • RC2_CBC Link icon

      public static final String RC2_CBC
    • IDEA_CBC Link icon

      public static final String IDEA_CBC
    • CAST5_CBC Link icon

      public static final String CAST5_CBC
    • AES128_CBC Link icon

      public static final String AES128_CBC
    • AES192_CBC Link icon

      public static final String AES192_CBC
    • AES256_CBC Link icon

      public static final String AES256_CBC
    • CAMELLIA128_CBC Link icon

      public static final String CAMELLIA128_CBC
    • CAMELLIA192_CBC Link icon

      public static final String CAMELLIA192_CBC
    • CAMELLIA256_CBC Link icon

      public static final String CAMELLIA256_CBC
    • SEED_CBC Link icon

      public static final String SEED_CBC
    • DES_EDE3_WRAP Link icon

      public static final String DES_EDE3_WRAP
    • AES128_WRAP Link icon

      public static final String AES128_WRAP
    • AES256_WRAP Link icon

      public static final String AES256_WRAP
    • CAMELLIA128_WRAP Link icon

      public static final String CAMELLIA128_WRAP
    • CAMELLIA192_WRAP Link icon

      public static final String CAMELLIA192_WRAP
    • CAMELLIA256_WRAP Link icon

      public static final String CAMELLIA256_WRAP
    • SEED_WRAP Link icon

      public static final String SEED_WRAP
    • ECDH_SHA1KDF Link icon

      public static final String ECDH_SHA1KDF
  • Constructor Details Link icon

    • SMIMEEnvelopedGenerator Link icon

      public SMIMEEnvelopedGenerator()
      base constructor
  • Method Details Link icon

    • addRecipientInfoGenerator Link icon

      public void addRecipientInfoGenerator(org.bouncycastle.cms.RecipientInfoGenerator recipientInfoGen) throws IllegalArgumentException
      add a recipientInfoGenerator.
      Throws:
      IllegalArgumentException
    • setBerEncodeRecipients Link icon

      public void setBerEncodeRecipients(boolean berEncodeRecipientSet)
      Use a BER Set to store the recipient information
    • generate Link icon

      public javax.mail.internet.MimeBodyPart generate(javax.mail.internet.MimeBodyPart content, org.bouncycastle.operator.OutputEncryptor encryptor) throws SMIMEException
      generate an enveloped object that contains an SMIME Enveloped object using the given content encryptor
      Throws:
      SMIMEException
    • generate Link icon

      public javax.mail.internet.MimeBodyPart generate(javax.mail.internet.MimeMessage message, org.bouncycastle.operator.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
      Throws:
      SMIMEException