package org.bouncycastle.asn1.bc;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class SignatureCheck extends org.bouncycastle.asn1.ASN1Object {
    private final org.bouncycastle.asn1.x509.AlgorithmIdentifier a;
    private final org.bouncycastle.asn1.ASN1Sequence b;
    private final org.bouncycastle.asn1.ASN1BitString c;

    private SignatureCheck(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        this.a = org.bouncycastle.asn1.x509.AlgorithmIdentifier.o(aSN1Sequence.B(0));
        int i = 1;
        if (aSN1Sequence.B(1) instanceof org.bouncycastle.asn1.ASN1TaggedObject) {
            this.b = org.bouncycastle.asn1.ASN1Sequence.z(org.bouncycastle.asn1.ASN1TaggedObject.I(aSN1Sequence.B(1)).E(true, 16));
            i = 2;
        } else {
            this.b = null;
        }
        this.c = org.bouncycastle.asn1.ASN1BitString.A(aSN1Sequence.B(i));
    }

    public static org.bouncycastle.asn1.bc.SignatureCheck o(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.bc.SignatureCheck) {
            return (org.bouncycastle.asn1.bc.SignatureCheck) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.bc.SignatureCheck(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(3);
        aSN1EncodableVector.a(this.a);
        org.bouncycastle.asn1.ASN1Sequence aSN1Sequence = this.b;
        if (aSN1Sequence != null) {
            aSN1EncodableVector.a(new org.bouncycastle.asn1.DERTaggedObject(0, aSN1Sequence));
        }
        aSN1EncodableVector.a(this.c);
        return new org.bouncycastle.asn1.DERSequence(aSN1EncodableVector);
    }

    public org.bouncycastle.asn1.x509.Certificate[] n() {
        org.bouncycastle.asn1.ASN1Sequence aSN1Sequence = this.b;
        if (aSN1Sequence == null) {
            return null;
        }
        int size = aSN1Sequence.size();
        org.bouncycastle.asn1.x509.Certificate[] certificateArr = new org.bouncycastle.asn1.x509.Certificate[size];
        for (int i = 0; i != size; i++) {
            certificateArr[i] = org.bouncycastle.asn1.x509.Certificate.o(this.b.B(i));
        }
        return certificateArr;
    }

    public org.bouncycastle.asn1.ASN1BitString p() {
        return new org.bouncycastle.asn1.DERBitString(this.c.y(), this.c.i());
    }

    public org.bouncycastle.asn1.x509.AlgorithmIdentifier q() {
        return this.a;
    }

    public SignatureCheck(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, byte[] bArr) {
        this.a = algorithmIdentifier;
        this.b = null;
        this.c = new org.bouncycastle.asn1.DERBitString(org.bouncycastle.util.Arrays.j(bArr));
    }

    public SignatureCheck(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, org.bouncycastle.asn1.x509.Certificate[] certificateArr, byte[] bArr) {
        this.a = algorithmIdentifier;
        this.b = new org.bouncycastle.asn1.DERSequence(certificateArr);
        this.c = new org.bouncycastle.asn1.DERBitString(org.bouncycastle.util.Arrays.j(bArr));
    }
}
