Package org.bouncycastle.cms.jcajce

Examples of org.bouncycastle.cms.jcajce.JceKeyTransRecipientId


        "Decrypting pkcsPkiEnvelope using key belonging to [issuer={}; serial={}]",
        recipient.getIssuerDN(), recipient.getSerialNumber());
    final RecipientInformationStore recipientInfos = pkcsPkiEnvelope
        .getRecipientInfos();
    RecipientInformation info = recipientInfos
        .get(new JceKeyTransRecipientId(recipient));

    if (info == null) {
      throw new MessageDecodingException(
          "Missing expected key transfer recipient");
    }
View Full Code Here


      MimeBodyPart decrypted = null;
      try
      {
         MimeBodyPart encryptedBodyPart = body;
         SMIMEEnveloped m = new SMIMEEnveloped(encryptedBodyPart);
         JceKeyTransRecipientId recId = new JceKeyTransRecipientId(cert);

         RecipientInformationStore recipients = m.getRecipientInfos();
         RecipientInformation recipient = recipients.get(recId);

         decrypted = SMIMEUtil.toMimeBodyPart(recipient.getContent(pKey, "BC"));
View Full Code Here

   }

   private MimeBodyPart decode2Mime(MimeBodyPart mp) throws MessagingException, CMSException, SMIMEException, NoSuchProviderException, IOException
   {
      SMIMEEnveloped m = new SMIMEEnveloped(mp);
      RecipientId recId = new JceKeyTransRecipientId(cert);

      RecipientInformationStore recipients = m.getRecipientInfos();
      RecipientInformation recipient = recipients.get(recId);

      return SMIMEUtil.toMimeBodyPart(recipient.getContent(privateKey, "BC"));
View Full Code Here

TOP

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

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.