package org.bouncycastle.asn1.cms; import java.io.IOException; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1Integer; import org.bouncycastle.asn1.ASN1SequenceParser; import org.bouncycastle.asn1.ASN1SetParser; import org.bouncycastle.asn1.ASN1TaggedObjectParser; /* loaded from: classes6.dex */ public class EnvelopedDataParser { private ASN1Encodable _nextObject; private boolean _originatorInfoCalled; private ASN1SequenceParser _seq; private ASN1Integer _version; public ASN1Integer getVersion() { return this._version; } public ASN1SetParser getUnprotectedAttrs() throws IOException { if (this._nextObject == null) { this._nextObject = this._seq.readObject(); } ASN1Encodable aSN1Encodable = this._nextObject; if (aSN1Encodable == null) { return null; } this._nextObject = null; return (ASN1SetParser) ((ASN1TaggedObjectParser) aSN1Encodable).getObjectParser(17, false); } public ASN1SetParser getRecipientInfos() throws IOException { if (!this._originatorInfoCalled) { getOriginatorInfo(); } if (this._nextObject == null) { this._nextObject = this._seq.readObject(); } ASN1SetParser aSN1SetParser = (ASN1SetParser) this._nextObject; this._nextObject = null; return aSN1SetParser; } public OriginatorInfo getOriginatorInfo() throws IOException { this._originatorInfoCalled = true; if (this._nextObject == null) { this._nextObject = this._seq.readObject(); } ASN1Encodable aSN1Encodable = this._nextObject; if (!(aSN1Encodable instanceof ASN1TaggedObjectParser) || ((ASN1TaggedObjectParser) aSN1Encodable).getTagNo() != 0) { return null; } ASN1SequenceParser aSN1SequenceParser = (ASN1SequenceParser) ((ASN1TaggedObjectParser) this._nextObject).getObjectParser(16, false); this._nextObject = null; return OriginatorInfo.getInstance(aSN1SequenceParser.toASN1Primitive()); } public EncryptedContentInfoParser getEncryptedContentInfo() throws IOException { if (this._nextObject == null) { this._nextObject = this._seq.readObject(); } ASN1Encodable aSN1Encodable = this._nextObject; if (aSN1Encodable == null) { return null; } this._nextObject = null; return new EncryptedContentInfoParser((ASN1SequenceParser) aSN1Encodable); } public EnvelopedDataParser(ASN1SequenceParser aSN1SequenceParser) throws IOException { this._seq = aSN1SequenceParser; this._version = ASN1Integer.getInstance(aSN1SequenceParser.readObject()); } }