Examples of generateEncapsulated()


Examples of org.bouncycastle.mail.smime.SMIMESignedGenerator.generateEncapsulated()

        gen.addSigner(_signKP.getPrivate(), _signCert, SMIMESignedGenerator.DIGEST_SHA1, new AttributeTable(signedAttrs), null);

        gen.addCertificatesAndCRLs(certs);

        MimeBodyPart res = gen.generateEncapsulated(msg, "BC");

        assertEquals("application/pkcs7-mime; name=smime.p7m; smime-type=signed-data", res.getHeader("Content-Type")[0]);
        assertEquals("attachment; filename=\"smime.p7m\"", res.getHeader("Content-Disposition")[0]);
        assertEquals("S/MIME Cryptographic Signed Data", res.getHeader("Content-Description")[0]);
    }
View Full Code Here

Examples of org.bouncycastle.mail.smime.SMIMESignedGenerator.generateEncapsulated()

        X509Store store = X509Store.getInstance("AttributeCertificate/Collection",
                                    new X509CollectionStoreParameters(Collections.singleton(attrCert)), "BC");

        gen.addAttributeCertificates(store);

        SMIMESigned s = new SMIMESigned(gen.generateEncapsulated(msg, "BC"));

        verifyMessageBytes(msg, s.getContent());

        verifySigners(s.getCertificatesAndCRLs("Collection", "BC"), s.getSignerInfos());
View Full Code Here

Examples of org.bouncycastle.mail.smime.SMIMESignedGenerator.generateEncapsulated()

        SMIMESignedGenerator gen = new SMIMESignedGenerator();
   
        gen.addSigner(_signKP.getPrivate(), _signCert, digestOid, new AttributeTable(signedAttrs), null);
        gen.addCertificatesAndCRLs(certs);
   
        return gen.generateEncapsulated(msg, "BC");
    }
   
    public void testCertificateManagement()
        throws Exception
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.