Package org.bouncycastle.cms.jcajce

Examples of org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder


  private OutputEncryptor getEncryptor() throws CMSException {
    if ("DES".equals(encAlg)) {
      return new DesOutputEncryptor();
    } else {
      return new JceCMSContentEncryptorBuilder(des_EDE3_CBC).build();
    }
  }
View Full Code Here


      {
         headers.putSingle("Content-Disposition", "attachment; filename=\"smime.p7m\"");
         headers.putSingle("Content-Type", "application/pkcs7-mime; smime-type=enveloped-data; name=\"smime.p7m\"");
         headers.putSingle("Content-Transfer-Encoding", "base64");

         OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
                 .setProvider("BC")
                 .build();
         if (out.getCertificate() == null) throw new NullPointerException("The certificate object was not set.");
         JceKeyTransRecipientInfoGenerator infoGenerator = new JceKeyTransRecipientInfoGenerator(out.getCertificate());
         infoGenerator.setProvider("BC");
View Full Code Here

   }

   @Test
   public void testBody() throws Exception
   {
      OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
              .setProvider("BC")
              .build();
      JceKeyTransRecipientInfoGenerator infoGenerator = new JceKeyTransRecipientInfoGenerator(cert);
      CMSEnvelopedDataStreamGenerator generator = new CMSEnvelopedDataStreamGenerator();
      generator.addRecipientInfoGenerator(infoGenerator);
View Full Code Here

      MimeBodyPart _msg = new MimeBodyPart(ih, "<customer name=\"bill\"/>".getBytes());


      SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
      OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
              .setProvider("BC")
              .build();
      gen.addKeyTransRecipient(cert);

      //
View Full Code Here

TOP

Related Classes of org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.