Package org.bouncycastle.mail.smime

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


        gen.addSigner(dsaOrigKP.getPrivate(), dsaOrigCert, SMIMESignedGenerator.DIGEST_SHA1);
        gen.addCertificatesAndCRLs(certs);


        MimeMultipart smm = gen.generate(msg, "BC");
        SMIMESigned   s = new  SMIMESigned(smm);

        verifyMessageBytes(msg, s.getContent());

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


        SMIMESignedGenerator gen = new SMIMESignedGenerator();
   
        gen.addSigner(_signKP.getPrivate(), _signCert, digestOid, new AttributeTable(signedAttrs), null);
        gen.addCertificatesAndCRLs(certs);

        return gen.generate(msg, "BC");
    }

    private MimeMultipart generateMultiPartGost(
        MimeBodyPart msg)
        throws Exception
View Full Code Here

        SMIMESignedGenerator gen = new SMIMESignedGenerator();

        gen.addSigner(_signGostKP.getPrivate(), _signGostCert, SMIMESignedGenerator.DIGEST_GOST3411);
        gen.addCertificatesAndCRLs(certs);

        return gen.generate(msg, "BC");
    }

    private MimeMultipart generateMultiPartECGost(
        MimeBodyPart msg)
        throws Exception
View Full Code Here

        SMIMESignedGenerator gen = new SMIMESignedGenerator();

        gen.addSigner(_signEcGostKP.getPrivate(), _signEcGostCert, SMIMESignedGenerator.DIGEST_GOST3411);
        gen.addCertificatesAndCRLs(certs);

        return gen.generate(msg, "BC");
    }

    private MimeMultipart generateMultiPartRsa(String digestOid, MimeBodyPart msg)
        throws Exception
    {
View Full Code Here

        SMIMESignedGenerator gen = new SMIMESignedGenerator("binary");

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

        MimeMultipart mm = gen.generate(m, "BC");

        SMIMESigned s = new SMIMESigned(mm);

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

        SMIMESignedGenerator gen = new SMIMESignedGenerator("binary");

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

        MimeMultipart mm = gen.generate(m, "BC");

        SMIMESigned s = new SMIMESigned(mm, "binary");

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

        SMIMESignedGenerator gen = new SMIMESignedGenerator("binary");

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

        MimeMultipart mm = gen.generate(m, "BC");

        SMIMESignedParser s = new SMIMESignedParser(mm, "binary");

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

        SMIMESignedGenerator gen = new SMIMESignedGenerator("binary");

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

        MimeMultipart mm = gen.generate(m, "BC");

        SMIMESignedParser s = new SMIMESignedParser(mm, "binary");

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

        m.setContent(mp);

        //
        // extract the multipart object from the SMIMESigned object.
        //
        MimeMultipart mm = gen.generate(m, "BC");

        //
        // Get a Session object and create the mail message
        //
        Properties props = System.getProperties();
View Full Code Here

        msg.setText("Hello world!");

        //
        // extract the multipart object from the SMIMESigned object.
        //
        MimeMultipart mm = gen.generate(msg, "BC");

        //
        // Get a Session object and create the mail message
        //
        Properties props = System.getProperties();
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.