Examples of addSignerInfoGenerator()


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

   {
      try
      {
         SMIMESignedGenerator gen = new SMIMESignedGenerator();
         SignerInfoGenerator signer = new JcaSimpleSignerInfoGeneratorBuilder().setProvider("BC").build("SHA1WITHRSA", out.getPrivateKey(), out.getCertificate());
         gen.addSignerInfoGenerator(signer);

         MimeMultipart mp = gen.generate(EnvelopedWriter.createBodyPart(providers, out));
         String contentType = mp.getContentType();
         contentType = contentType.replace("\r\n", "").replace("\t", " ");
         headers.putSingle("Content-Type", contentType);
View Full Code Here

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

   @Test
   public void testOutput2() throws Exception
   {
      SMIMESignedGenerator gen = new SMIMESignedGenerator();
      SignerInfoGenerator signer = new JcaSimpleSignerInfoGeneratorBuilder().setProvider("BC").build("SHA1WITHRSA", privateKey, cert);
      gen.addSignerInfoGenerator(signer);

      MimeMultipart mp = gen.generate(createMsg());

      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mp.writeTo(os);
View Full Code Here

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

   @Test
   public void testPythonVerified() throws Exception
   {
      SMIMESignedGenerator gen = new SMIMESignedGenerator();
      SignerInfoGenerator signer = new JcaSimpleSignerInfoGeneratorBuilder().setProvider("BC").build("SHA1WITHRSA", privateKey, cert);
      gen.addSignerInfoGenerator(signer);

      MimeMultipart mp = gen.generate(createMsg());
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mp.writeTo(os);
      String contentType = mp.getContentType();
View Full Code Here

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

   @Test
   public void testPythonVerifiedBad() throws Exception
   {
      SMIMESignedGenerator gen = new SMIMESignedGenerator();
      SignerInfoGenerator signer = new JcaSimpleSignerInfoGeneratorBuilder().setProvider("BC").build("SHA1WITHRSA", badKey, cert);
      gen.addSignerInfoGenerator(signer);

      MimeMultipart mp = gen.generate(createMsg());
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mp.writeTo(os);
      String contentType = mp.getContentType();
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.