AuthEnvelopedData authEnvData = AuthEnvelopedData.getInstance(contentInfo.getContent()); this.originator = authEnvData.getOriginatorInfo(); ASN1Set recipientInfos = authEnvData.getRecipientInfos(); EncryptedContentInfo authEncInfo = authEnvData.getAuthEncryptedContentInfo(); this.authEncAlg = authEncInfo.getContentEncryptionAlgorithm(); this.authAttrs = authEnvData.getAuthAttrs(); this.mac = authEnvData.getMac().getOctets(); this.unauthAttrs = authEnvData.getUnauthAttrs();
/** * return an AuthEnvelopedData object from the given object. * * @param obj the object we want converted. * @throws IllegalArgumentException if the object cannot be converted. */ public static AuthEnvelopedData getInstance( Object obj) { if (obj == null || obj instanceof AuthEnvelopedData) { return (AuthEnvelopedData)obj; } if (obj instanceof ASN1Sequence) { return new AuthEnvelopedData((ASN1Sequence)obj); } throw new IllegalArgumentException("Invalid AuthEnvelopedData: " + obj.getClass().getName()); }
authEnvelopedData = AuthEnvelopedData.getInstance(Utils.fetchWrappedData(cmsData)); elementRecipient = authEnvelopedData.getRecipientInfos().getObjects(); final EncryptedContentInfo contenidoCifrado = authEnvelopedData.getAuthEncryptedContentInfo();
/** * return an AuthEnvelopedData object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @throws IllegalArgumentException if the object held by the * tagged object cannot be converted. */ public static AuthEnvelopedData getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
/** * Return an AuthEnvelopedData object from a tagged object. * <p> * Accepted inputs: * <ul> * <li> {@link org.spongycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats * </ul> * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @return a reference that can be assigned to AuthEnvelopedData (may be null) * @throws IllegalArgumentException if the object held by the * tagged object cannot be converted. */ public static AuthEnvelopedData getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
AuthEnvelopedData authEnvData = AuthEnvelopedData.getInstance(contentInfo.getContent()); this.originator = authEnvData.getOriginatorInfo(); ASN1Set recipientInfos = authEnvData.getRecipientInfos(); EncryptedContentInfo authEncInfo = authEnvData.getAuthEncryptedContentInfo(); this.authEncAlg = authEncInfo.getContentEncryptionAlgorithm(); this.authAttrs = authEnvData.getAuthAttrs(); this.mac = authEnvData.getMac().getOctets(); this.unauthAttrs = authEnvData.getUnauthAttrs();
final ASN1TaggedObject doj = (ASN1TaggedObject) e.nextElement(); final ASN1Sequence authenticatedEnvelopedData = (ASN1Sequence) doj.getObject(); AuthEnvelopedData.getInstance(authenticatedEnvelopedData);
/** * Return an AuthEnvelopedData object from the given object. * <p> * Accepted inputs: * <ul> * <li> null → null * <li> {@link AuthEnvelopedData} object * <li> {@link ASN1Sequence org.spongycastle.asn1.ASN1Sequence} input formats with AuthEnvelopedData structure inside * </ul> * * @param obj The object we want converted. * @return a reference that can be assigned to AuthEnvelopedData (may be null) * @throws IllegalArgumentException if the object cannot be converted, or was null. */ public static AuthEnvelopedData getInstance( Object obj) { if (obj == null || obj instanceof AuthEnvelopedData) { return (AuthEnvelopedData)obj; } if (obj instanceof ASN1Sequence) { return new AuthEnvelopedData((ASN1Sequence)obj); } throw new IllegalArgumentException("Invalid AuthEnvelopedData: " + obj.getClass().getName()); }
final AuthEnvelopedData authEnv = AuthEnvelopedData.getInstance(doj.getObject()); OriginatorInfo origInfo = authEnv.getOriginatorInfo(); ASN1Set certs = null; if (origInfo != null) { PKCSObjectIdentifiers.id_ct_authEnvelopedData, new AuthEnvelopedData(origInfo, // OriginatorInfo authEnv.getRecipientInfos(), // ASN1Set authEnv.getAuthEncryptedContentInfo(), authEnv.getAuthAttrs(), authEnv.getMac(), authEnv.getUnauthAttrs())).getEncoded(ASN1Encoding.DER);
new AuthEnvelopedData(origInfo, // originatorInfo, new DERSet(infos.getRecipientInfos()), // recipientInfos,