Package org.bouncycastle.operator

Examples of org.bouncycastle.operator.OutputEncryptor


    edGenerator.addRecipientInfoGenerator(recipientGenerator);
    LOGGER.debug(
        "Encrypting pkcsPkiEnvelope using key belonging to [issuer={}; serial={}]",
        recipient.getIssuerDN(), recipient.getSerialNumber());

    OutputEncryptor encryptor;
    try {
      encryptor = getEncryptor();
    } catch (CMSException e) {
      throw new MessageEncodingException(e);
    }
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.operator.OutputEncryptor

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.