package org.bouncycastle.asn1.pkcs;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class ContentInfo extends org.bouncycastle.asn1.ASN1Object implements org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers {
    private org.bouncycastle.asn1.ASN1ObjectIdentifier a;
    private org.bouncycastle.asn1.ASN1Encodable b;
    private boolean c;

    public ContentInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier aSN1ObjectIdentifier, org.bouncycastle.asn1.ASN1Encodable aSN1Encodable) {
        this.c = true;
        this.a = aSN1ObjectIdentifier;
        this.b = aSN1Encodable;
    }

    public static org.bouncycastle.asn1.pkcs.ContentInfo p(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.pkcs.ContentInfo) {
            return (org.bouncycastle.asn1.pkcs.ContentInfo) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.pkcs.ContentInfo(org.bouncycastle.asn1.ASN1Sequence.z(obj));
        }
        return null;
    }

    @Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
    public org.bouncycastle.asn1.ASN1Primitive j() {
        org.bouncycastle.asn1.ASN1EncodableVector aSN1EncodableVector = new org.bouncycastle.asn1.ASN1EncodableVector(2);
        aSN1EncodableVector.a(this.a);
        org.bouncycastle.asn1.ASN1Encodable aSN1Encodable = this.b;
        if (aSN1Encodable != null) {
            aSN1EncodableVector.a(new org.bouncycastle.asn1.BERTaggedObject(true, 0, aSN1Encodable));
        }
        return this.c ? new org.bouncycastle.asn1.BERSequence(aSN1EncodableVector) : new org.bouncycastle.asn1.DLSequence(aSN1EncodableVector);
    }

    public org.bouncycastle.asn1.ASN1Encodable n() {
        return this.b;
    }

    public org.bouncycastle.asn1.ASN1ObjectIdentifier o() {
        return this.a;
    }

    private ContentInfo(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        this.c = true;
        java.util.Enumeration enumerationC = aSN1Sequence.C();
        this.a = (org.bouncycastle.asn1.ASN1ObjectIdentifier) enumerationC.nextElement();
        if (enumerationC.hasMoreElements()) {
            this.b = ((org.bouncycastle.asn1.ASN1TaggedObject) enumerationC.nextElement()).G();
        }
        this.c = aSN1Sequence instanceof org.bouncycastle.asn1.BERSequence;
    }
}
