Examples of RecipientInformationStore


Examples of org.bouncycastle.cms.RecipientInformationStore

        KeyFactory kFact = KeyFactory.getInstance("RSA", "BC");
        Key key = kFact.generatePrivate(new PKCS8EncodedKeySpec(bobPrivRsaEncrypt));

        CMSEnvelopedData ed = new CMSEnvelopedData(rfc4134ex5_2);

        RecipientInformationStore  recipients = ed.getRecipientInfos();

        assertEquals("1.2.840.113549.3.2", ed.getEncryptionAlgOID());

        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();

        if (it.hasNext())
        {
            while (it.hasNext())
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

    public void testOriginatorInfo()
        throws Exception
    {
        CMSEnvelopedData env = new CMSEnvelopedData(CMSSampleMessages.originatorMessage);

        RecipientInformationStore  recipients = env.getRecipientInfos();

        assertEquals(CMSEnvelopedDataGenerator.DES_EDE3_CBC, env.getEncryptionAlgOID());

    }
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

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

        RecipientInformationStore  recipients = ed.getRecipientInfos();

        assertEquals(ed.getEncryptionAlgOID(),
                                   CMSEnvelopedDataGenerator.AES128_CBC);

        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();

        if (it.hasNext())
        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

    {
        byte[] data = Hex.decode("504b492d4320434d5320456e76656c6f706564446174612053616d706c65");

        CMSEnvelopedData ed = new CMSEnvelopedData(message);

        RecipientInformationStore  recipients = ed.getRecipientInfos();

        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();

        assertEquals(wrapAlg, ed.getEncryptionAlgOID());

        if (it.hasNext())
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

    {
        byte[] data = Hex.decode("504b492d4320434d5320456e76656c6f706564446174612053616d706c65");

        CMSEnvelopedData ed = new CMSEnvelopedData(message);

        RecipientInformationStore  recipients = ed.getRecipientInfos();

        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();

        assertEquals(wrapAlg, ed.getEncryptionAlgOID());

        if (it.hasNext())
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

                  "1JcTsADStez1eY4+rO4DtyBIyUYQ3pilnbirfPkAAAAAAAAAAAAA");


        CMSEnvelopedDataParser     ep = new CMSEnvelopedDataParser(envData);

        RecipientInformationStore  recipients = ep.getRecipientInfos();

        assertEquals(ep.getEncryptionAlgOID(), CMSEnvelopedDataGenerator.AES128_CBC);
       
        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();

        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyData);
        KeyFactory          keyFact = KeyFactory.getInstance("RSA", "BC");
        Key                 priKey = keyFact.generatePrivate(keySpec);
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

        String                expectedOid,
        byte[]                expectedData)
        throws Exception
    {
        CMSEnvelopedDataParser     ep = new CMSEnvelopedDataParser(encodedStream.toByteArray());
        RecipientInformationStore  recipients = ep.getRecipientInfos();
   
        assertEquals(ep.getEncryptionAlgOID(), expectedOid);
       
        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();
       
        while (it.hasNext())
        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

        }
       
        out.close();
       
        CMSEnvelopedDataParser     ep = new CMSEnvelopedDataParser(bOut.toByteArray());
        RecipientInformationStore  recipients = ep.getRecipientInfos();
        Collection                 c = recipients.getRecipients();
        Iterator                   it = c.iterator();
       
        if (it.hasNext())
        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

       
        out.close();
       
        CMSEnvelopedDataParser     ep = new CMSEnvelopedDataParser(bOut.toByteArray());
   
        RecipientInformationStore  recipients = ep.getRecipientInfos();
   
        assertEquals(ep.getEncryptionAlgOID(), CMSEnvelopedDataGenerator.AES128_CBC);
       
        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();
       
        while (it.hasNext())
        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
View Full Code Here

Examples of org.bouncycastle.cms.RecipientInformationStore

       
        out.close();
       
        CMSEnvelopedDataParser     ep = new CMSEnvelopedDataParser(bOut.toByteArray());

        RecipientInformationStore  recipients = ep.getRecipientInfos();

        assertEquals(ep.getEncryptionAlgOID(), CMSEnvelopedDataGenerator.CAST5_CBC);
       
        Collection  c = recipients.getRecipients();
        Iterator    it = c.iterator();
       
        while (it.hasNext())
        {
            RecipientInformation   recipient = (RecipientInformation)it.next();
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.