package org.bouncycastle.asn1.x509;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class ExtendedKeyUsage extends org.bouncycastle.asn1.ASN1Object {
    java.util.Hashtable a = new java.util.Hashtable();
    org.bouncycastle.asn1.ASN1Sequence b;

    private ExtendedKeyUsage(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        this.b = aSN1Sequence;
        java.util.Enumeration enumerationC = aSN1Sequence.C();
        while (enumerationC.hasMoreElements()) {
            org.bouncycastle.asn1.ASN1Encodable aSN1Encodable = (org.bouncycastle.asn1.ASN1Encodable) enumerationC.nextElement();
            if (!(aSN1Encodable.j() instanceof org.bouncycastle.asn1.ASN1ObjectIdentifier)) {
                throw new java.lang.IllegalArgumentException("Only ASN1ObjectIdentifiers allowed in ExtendedKeyUsage.");
            }
            this.a.put(aSN1Encodable, aSN1Encodable);
        }
    }

    public static org.bouncycastle.asn1.x509.ExtendedKeyUsage n(org.bouncycastle.asn1.x509.Extensions extensions) {
        return o(org.bouncycastle.asn1.x509.Extensions.p(extensions, org.bouncycastle.asn1.x509.Extension.x));
    }

    public static org.bouncycastle.asn1.x509.ExtendedKeyUsage o(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.x509.ExtendedKeyUsage) {
            return (org.bouncycastle.asn1.x509.ExtendedKeyUsage) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.x509.ExtendedKeyUsage(org.bouncycastle.asn1.ASN1Sequence.z(obj));
        }
        return null;
    }

    @Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
    public org.bouncycastle.asn1.ASN1Primitive j() {
        return this.b;
    }

    public org.bouncycastle.asn1.x509.KeyPurposeId[] p() {
        org.bouncycastle.asn1.x509.KeyPurposeId[] keyPurposeIdArr = new org.bouncycastle.asn1.x509.KeyPurposeId[this.b.size()];
        java.util.Enumeration enumerationC = this.b.C();
        int i = 0;
        while (enumerationC.hasMoreElements()) {
            keyPurposeIdArr[i] = org.bouncycastle.asn1.x509.KeyPurposeId.o(enumerationC.nextElement());
            i++;
        }
        return keyPurposeIdArr;
    }

    public boolean q(org.bouncycastle.asn1.x509.KeyPurposeId keyPurposeId) {
        return this.a.get(keyPurposeId) != null;
    }
}
