package org.bouncycastle.asn1.x509;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class SubjectPublicKeyInfo extends org.bouncycastle.asn1.ASN1Object {
    private org.bouncycastle.asn1.x509.AlgorithmIdentifier a;
    private org.bouncycastle.asn1.ASN1BitString b;

    public SubjectPublicKeyInfo(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        if (aSN1Sequence.size() == 2) {
            java.util.Enumeration enumerationC = aSN1Sequence.C();
            this.a = org.bouncycastle.asn1.x509.AlgorithmIdentifier.o(enumerationC.nextElement());
            this.b = org.bouncycastle.asn1.ASN1BitString.A(enumerationC.nextElement());
        } else {
            throw new java.lang.IllegalArgumentException("Bad sequence size: " + aSN1Sequence.size());
        }
    }

    public static org.bouncycastle.asn1.x509.SubjectPublicKeyInfo o(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.x509.SubjectPublicKeyInfo) {
            return (org.bouncycastle.asn1.x509.SubjectPublicKeyInfo) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.x509.SubjectPublicKeyInfo(org.bouncycastle.asn1.ASN1Sequence.z(obj));
        }
        return null;
    }

    @Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
    public org.bouncycastle.asn1.ASN1Primitive j() {
        return new org.bouncycastle.asn1.DERSequence(this.a, this.b);
    }

    public org.bouncycastle.asn1.x509.AlgorithmIdentifier n() {
        return this.a;
    }

    public org.bouncycastle.asn1.ASN1BitString p() {
        return this.b;
    }

    public org.bouncycastle.asn1.ASN1Primitive q() {
        return org.bouncycastle.asn1.ASN1Primitive.u(this.b.C());
    }

    public SubjectPublicKeyInfo(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, org.bouncycastle.asn1.ASN1BitString aSN1BitString) {
        this.b = aSN1BitString;
        this.a = algorithmIdentifier;
    }

    public SubjectPublicKeyInfo(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, org.bouncycastle.asn1.ASN1Encodable aSN1Encodable) {
        this.b = new org.bouncycastle.asn1.DERBitString(aSN1Encodable);
        this.a = algorithmIdentifier;
    }

    public SubjectPublicKeyInfo(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, byte[] bArr) {
        this.b = new org.bouncycastle.asn1.DERBitString(bArr);
        this.a = algorithmIdentifier;
    }
}
