Package org.bouncycastle.cms

Examples of org.bouncycastle.cms.RecipientId


        // we want encrypted.
        //

        MimeBodyPart   mp = gen.generate(msg, algorithmOid, "BC");
        SMIMEEnveloped m = new SMIMEEnveloped(mp);
        RecipientId    recId = getRecipientId(_reciCert);

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

        MimeBodyPart    res = SMIMEUtil.toMimeBodyPart(recipient.getContent(_reciKP.getPrivate(), "BC"));
View Full Code Here


        // we want encrypted.
        //

        MimeBodyPart         mp = gen.generate(msg, algorithmOid, "BC");
        SMIMEEnvelopedParser m = new SMIMEEnvelopedParser(mp);
        RecipientId          recId = getRecipientId(_reciCert);

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

        MimeBodyPart    res = SMIMEUtil.toMimeBodyPart(recipient.getContent(_reciKP.getPrivate(), "BC"));
View Full Code Here

    private RecipientId getRecipientId(
        X509Certificate cert)
        throws IOException, CertificateEncodingException
    {
        RecipientId          recId = new RecipientId();

        recId.setSerialNumber(cert.getSerialNumber());
        recId.setIssuer(PrincipalUtil.getIssuerX509Principal(cert).getEncoded());
        return recId;
    }
View Full Code Here

        //
        // find the certificate for the private key and generate a
        // suitable recipient identifier.
        //
        X509Certificate cert = (X509Certificate)ks.getCertificate(keyAlias);
        RecipientId     recId = new RecipientId();

        recId.setSerialNumber(cert.getSerialNumber());
        recId.setIssuer(cert.getIssuerX500Principal().getEncoded());

        //
        // Get a Session object with the default properties.
        //        
        Properties props = System.getProperties();
View Full Code Here

        //
        // find the certificate for the private key and generate a
        // suitable recipient identifier.
        //
        X509Certificate cert = (X509Certificate)ks.getCertificate(keyAlias);
        RecipientId     recId = new RecipientId();

        recId.setSerialNumber(cert.getSerialNumber());
        recId.setIssuer(cert.getIssuerX500Principal().getEncoded());

        //
        // Get a Session object with the default properties.
        //        
        Properties props = System.getProperties();
View Full Code Here

       
        RecipientInformationStore  recipients = ep.getRecipientInfos();
   
        assertEquals(ep.getEncryptionAlgOID(), CMSEnvelopedDataGenerator.DES_EDE3_CBC);
       
        RecipientId                recSel = new RecipientId();
       
        recSel.setKeyIdentifier(kekId2);
       
        RecipientInformation       recipient = recipients.get(recSel);
       
        assertEquals(recipient.getKeyEncryptionAlgOID(), "2.16.840.1.101.3.4.1.25");
       
View Full Code Here

        RecipientInformationStore  recipients = ep.getRecipientInfos();

        assertEquals(ep.getEncryptionAlgOID(), CMSEnvelopedDataGenerator.AES128_CBC);

        RecipientId                recSel = new RecipientId();

        recSel.setIssuer(PrincipalUtil.getIssuerX509Principal(_reciEcCert).getEncoded());
        recSel.setSerialNumber(_reciEcCert.getSerialNumber());

        RecipientInformation       recipient = recipients.get(recSel);

        CMSTypedStream recData = recipient.getContentStream(_reciEcKP.getPrivate(), "BC");
View Full Code Here

TOP

Related Classes of org.bouncycastle.cms.RecipientId

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.