Examples of CMSTypedStream


Examples of org.bouncycastle.cms.CMSTypedStream

        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
   
            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());
           
            CMSTypedStream recData = recipient.getContentStream(_reciKP.getPrivate(), "BC");
           
            assertEquals(true, Arrays.equals(expectedData, CMSTestUtil.streamToByteArray(recData.getContentStream())));
        }
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
   
            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());
           
            CMSTypedStream recData = recipient.getContentStream(_reciKP.getPrivate(), "BC");
           
            InputStream           dataStream = recData.getContentStream();
            ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
            int                   len;
            byte[]                buf = new byte[BUFFER_SIZE];
            int                   count = 0;
           
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
   
            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());
           
            CMSTypedStream recData = recipient.getContentStream(_reciKP.getPrivate(), "BC");
           
            assertEquals(true, Arrays.equals(data, CMSTestUtil.streamToByteArray(recData.getContentStream())));
        }
       
        ep.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        {
            RecipientInformation   recipient = (RecipientInformation)it.next();

            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());
           
            CMSTypedStream recData = recipient.getContentStream(_reciKP.getPrivate(), "SunJCE");
           
            assertEquals(true, Arrays.equals(data, CMSTestUtil.streamToByteArray(recData.getContentStream())));
        }
       
        ep.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        {
            RecipientInformation   recipient = (RecipientInformation)it.next();

            assertEquals(recipient.getKeyEncryptionAlgOID(), "2.16.840.1.101.3.4.1.25");
           
            CMSTypedStream recData = recipient.getContentStream(kek, "BC");
           
            assertEquals(true, Arrays.equals(data, CMSTestUtil.streamToByteArray(recData.getContentStream())));
        }
       
        ep.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

       
        RecipientInformation       recipient = recipients.get(recSel);
       
        assertEquals(recipient.getKeyEncryptionAlgOID(), "2.16.840.1.101.3.4.1.25");
       
        CMSTypedStream recData = recipient.getContentStream(kek2, "BC");
       
        assertEquals(true, Arrays.equals(data, CMSTestUtil.streamToByteArray(recData.getContentStream())));

        ep.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        recSel.setIssuer(PrincipalUtil.getIssuerX509Principal(_reciEcCert).getEncoded());
        recSel.setSerialNumber(_reciEcCert.getSerialNumber());

        RecipientInformation       recipient = recipients.get(recSel);

        CMSTypedStream recData = recipient.getContentStream(_reciEcKP.getPrivate(), "BC");

        assertEquals(true, Arrays.equals(data, CMSTestUtil.streamToByteArray(recData.getContentStream())));

        ep.close();
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        gen.addCertificatesAndCRLs(certs);
   
        CMSSignedData s = gen.generate(CMSSignedDataGenerator.DATA, msg, false, "BC", false);

        CMSSignedDataParser     sp = new CMSSignedDataParser(
                new CMSTypedStream(new ByteArrayInputStream(TEST_MESSAGE.getBytes())), s.getEncoded());
       
        sp.getSignedContent().drain();
       
        //
        // compute expected content digest
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        gen.addCertificatesAndCRLs(certs);
   
        CMSSignedData s = gen.generate(CMSSignedDataGenerator.DATA, msg, false, "BC", false);
   
        CMSSignedDataParser     sp = new CMSSignedDataParser(
                new CMSTypedStream(new ByteArrayInputStream(TEST_MESSAGE.getBytes())), s.getEncoded());
       
        sp.getSignedContent().drain();
       
        //
        // compute expected content digest
View Full Code Here

Examples of org.bouncycastle.cms.CMSTypedStream

        sigOut.write(TEST_MESSAGE.getBytes());
       
        sigOut.close();
       
        CMSSignedDataParser     sp = new CMSSignedDataParser(
                new CMSTypedStream(new ByteArrayInputStream(TEST_MESSAGE.getBytes())), bOut.toByteArray());
   
        sp.getSignedContent().drain();
       
        //
        // compute expected content digest
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.