Examples of addKeyTransRecipient()


Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

       
        byte[]          data     = "WallaWallaWashington".getBytes();
   
        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();
   
        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                CMSEnvelopedDataGenerator.CAST5_CBC, "SunJCE");
        RecipientInformationStore  recipients = ed.getRecipientInfos();
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = "WallaWallaBouncyCastle".getBytes();

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                "1.2.840.113549.3.4", "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = "WallaWallaBouncyCastle".getBytes();

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                "1.2.840.113549.3.4", 128, "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = "WallaWallaBouncyCastle".getBytes();

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                "1.3.14.3.2.7", "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = new byte[] { 0, 1, 2, 3 };

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                              new CMSProcessableByteArray(data),
                              CMSEnvelopedDataGenerator.AES128_CBC, "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = "WallaWallaWashington".getBytes();

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(_reciCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                generatorOID, "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataGenerator.addKeyTransRecipient()

    {
        byte[]          data     = "WallaWallaWashington".getBytes();

        CMSEnvelopedDataGenerator edGen = new CMSEnvelopedDataGenerator();

        edGen.addKeyTransRecipient(keyCert);

        CMSEnvelopedData ed = edGen.generate(
                                new CMSProcessableByteArray(data),
                                algorithm, null);
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataStreamGenerator.addKeyTransRecipient()

     */
    public static void encrypt(final InputStream is, OutputStream os, X509Certificate cert) throws Exception {
        final InputStream bis = new BufferedInputStream(is, bufferSize);
        final OutputStream bos = new BufferedOutputStream(os, bufferSize);
        final CMSEnvelopedDataStreamGenerator edGen = new CMSEnvelopedDataStreamGenerator();
        edGen.addKeyTransRecipient(cert.getPublicKey(), "hej".getBytes() );
        final OutputStream out = edGen.open(bos, CMSEnvelopedGenerator.AES128_CBC, "BC");
        fromInToOut(bis, out);
        bos.close();
        os.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataStreamGenerator.addKeyTransRecipient()

        //
        // unbuffered
        //
        CMSEnvelopedDataStreamGenerator edGen = new CMSEnvelopedDataStreamGenerator();
   
        edGen.addKeyTransRecipient(_reciCert);
   
        ByteArrayOutputStream  bOut = new ByteArrayOutputStream();
       
        OutputStream out = edGen.open(
                                bOut, CMSEnvelopedDataGenerator.AES128_CBC, "BC");
View Full Code Here

Examples of org.bouncycastle.cms.CMSEnvelopedDataStreamGenerator.addKeyTransRecipient()

        //
        // Using buffered output - should be == to unbuffered
        //
        edGen = new CMSEnvelopedDataStreamGenerator();
   
        edGen.addKeyTransRecipient(_reciCert);
   
        bOut = new ByteArrayOutputStream();
       
        out = edGen.open(bOut, CMSEnvelopedDataGenerator.AES128_CBC, "BC");
   
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.