Examples of RecipientEncryptedKey


Examples of org.bouncycastle.asn1.cms.RecipientEncryptedKey

                keyCipher.init(Cipher.WRAP_MODE, secKey, random);

                ASN1OctetString         encKey = new DEROctetString(
                                                        keyCipher.wrap(key));

                RecipientEncryptedKey rKey = new RecipientEncryptedKey(new KeyAgreeRecipientIdentifier(
                                                                            new IssuerAndSerialNumber(PrincipalUtil.getIssuerX509Principal(cert), cert.getSerialNumber())),
                                                 encKey);

                return new RecipientInfo(new KeyAgreeRecipientInfo(originator, ukm, keyEncAlg, new DERSequence(rKey)));
            }
View Full Code Here

Examples of org.bouncycastle.asn1.cms.RecipientEncryptedKey

//        _encAlg = encAlg;

        try
        {
            ASN1Sequence s = _info.getRecipientEncryptedKeys();
            RecipientEncryptedKey id = RecipientEncryptedKey.getInstance(s.getObjectAt(0));

            IssuerAndSerialNumber iAnds = id.getIdentifier().getIssuerAndSerialNumber();

            _rid = new RecipientId();
            _rid.setIssuer(iAnds.getName().getEncoded());
            _rid.setSerialNumber(iAnds.getSerialNumber().getValue());

            _encryptedKey = id.getEncryptedKey();
        }
        catch (IOException e)
        {
            throw new IllegalArgumentException("invalid rid in KeyAgreeRecipientInformation");
        }
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.