package org.bouncycastle.asn1.bc;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class ExternalValue extends org.bouncycastle.asn1.ASN1Object {
    private final org.bouncycastle.asn1.x509.GeneralNames a;
    private final org.bouncycastle.asn1.x509.AlgorithmIdentifier b;
    private final byte[] c;

    private ExternalValue(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        if (aSN1Sequence.size() != 3) {
            throw new java.lang.IllegalArgumentException("unknown sequence");
        }
        this.a = org.bouncycastle.asn1.x509.GeneralNames.o(aSN1Sequence.B(0));
        this.b = org.bouncycastle.asn1.x509.AlgorithmIdentifier.o(aSN1Sequence.B(1));
        boolean z = aSN1Sequence.B(2) instanceof org.bouncycastle.asn1.ASN1BitString;
        org.bouncycastle.asn1.ASN1Encodable aSN1EncodableB = aSN1Sequence.B(2);
        if (z) {
            this.c = org.bouncycastle.asn1.ASN1BitString.A(aSN1EncodableB).C();
        } else {
            this.c = org.bouncycastle.asn1.ASN1OctetString.y(aSN1EncodableB).A();
        }
    }

    public static org.bouncycastle.asn1.bc.ExternalValue p(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.bc.ExternalValue) {
            return (org.bouncycastle.asn1.bc.ExternalValue) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.bc.ExternalValue(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();
        aSN1EncodableVector.a(this.a);
        aSN1EncodableVector.a(this.b);
        aSN1EncodableVector.a(new org.bouncycastle.asn1.DEROctetString(this.c));
        return new org.bouncycastle.asn1.DERSequence(aSN1EncodableVector);
    }

    public org.bouncycastle.asn1.x509.AlgorithmIdentifier n() {
        return this.b;
    }

    public byte[] o() {
        return org.bouncycastle.util.Arrays.j(this.c);
    }

    public org.bouncycastle.asn1.x509.GeneralName q() {
        return this.a.q()[0];
    }

    public ExternalValue(org.bouncycastle.asn1.x509.GeneralName generalName, org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, byte[] bArr) {
        this.a = new org.bouncycastle.asn1.x509.GeneralNames(generalName);
        this.b = algorithmIdentifier;
        this.c = org.bouncycastle.util.Arrays.j(bArr);
    }
}
