Examples of generate()


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

        CertStore certs = CertStore.getInstance("Collection",
                        new CollectionCertStoreParameters(certList), "BC");

        SMIMECompressedGenerator  cGen = new SMIMECompressedGenerator();

        MimeBodyPart   mp = cGen.generate(msg, SMIMECompressedGenerator.ZLIB);

        ASN1EncodableVector signedAttrs = generateSignedAttributes();

        SMIMESignedGenerator gen = new SMIMESignedGenerator();
View Full Code Here

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

      //
      // generate a MimeBodyPart object which encapsulates the content
      // we want encrypted.
      //

      MimeBodyPart mp = gen.generate(_msg, encryptor);

      output(mp);
   }

   private void output(MimeBodyPart mp) throws IOException, MessagingException
View Full Code Here

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

       
        // create the generator for creating an smime/signed MimeMultipart
        SMIMESignedGenerator generator = createGenerator();
       
        // do it
        return generator.generate(message, "BC");
       
    }
   
    /**
     * Generates a signed MimeMultipart from a MimeBodyPart.
View Full Code Here

Examples of org.bouncycastle.ocsp.BasicOCSPRespGenerator.generate()

        //
        BasicOCSPRespGenerator respGen = new BasicOCSPRespGenerator(signKP.getPublic());

        respGen.addResponse(id, CertificateStatus.GOOD);

        BasicOCSPResp resp = respGen.generate("SHA1withECDSA", signKP.getPrivate(), chain, new Date(), "BC");
    }

    private void testRSA()
        throws Exception
    {
View Full Code Here

Examples of org.bouncycastle.ocsp.OCSPReqGenerator.generate()

        // basic request generation
        //
        OCSPReqGenerator gen = new OCSPReqGenerator();
        gen.addRequest(id);

        OCSPReq req = gen.generate();

        if (req.isSigned())
        {
            fail("signed but shouldn't be");
        }
View Full Code Here

Examples of org.bouncycastle.ocsp.OCSPRespGenerator.generate()

        //
        // simple response generation
        //
        OCSPRespGenerator respGen = new OCSPRespGenerator();
        OCSPResp resp = respGen.generate(OCSPRespGenerator.SUCCESSFUL, response.getResponseObject());

        if (!resp.getResponseObject().equals(response.getResponseObject()))
        {
            fail("response fails to match");
        }
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSignatureGenerator.generate()

                litOut.flush();
            }
        } finally {
            IOHelper.close(litOut);
            if (sigGen != null) {
                sigGen.generate().encode(comOut);
            }
            IOHelper.close(comOut, encOut, outputStream, input);
        }
    }
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator.generate()

        spGen.setSignerUserID(false, sigKeyUserid);

        int algorithm = sigSecretKey.getPublicKey().getAlgorithm();
        PGPSignatureGenerator sigGen = new PGPSignatureGenerator(algorithm, HashAlgorithmTags.SHA1, "BC");
        sigGen.initSign(PGPSignature.BINARY_DOCUMENT, sigPrivateKey);
        sigGen.setHashedSubpackets(spGen.generate());
        sigGen.generateOnePassVersion(false).encode(out);
        return sigGen;
    }

    public Object unmarshal(Exchange exchange, InputStream encryptedStream) throws Exception {
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPUserAttributeSubpacketVectorGenerator.generate()

        PGPUserAttributeSubpacketVectorGenerator vGen = new PGPUserAttributeSubpacketVectorGenerator();

        vGen.setImageAttribute(ImageAttribute.JPEG, jpegImage);

        PGPUserAttributeSubpacketVector uVec = vGen.generate();

        PGPSignatureGenerator sGen = new PGPSignatureGenerator(new BcPGPContentSignerBuilder(PublicKeyAlgorithmTags.RSA_GENERAL, HashAlgorithmTags.SHA1));

        sGen.init(PGPSignature.POSITIVE_CERTIFICATION, pgpSec.getSecretKey().extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(pass)));
View Full Code Here

Examples of org.bouncycastle.openpgp.PGPV3SignatureGenerator.generate()

        lOut.write(TEST_DATA);
        sGen.update(TEST_DATA);
       
        lGen.close();
   
        sGen.generate().encode(bOut);
       
        return bOut.toByteArray();
    }
   
    private void testTextSigV3(
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.