package org.bouncycastle.cert;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class X509CertificateHolder implements org.bouncycastle.util.Encodable, java.io.Serializable {
    private transient org.bouncycastle.asn1.x509.Certificate a;
    private transient org.bouncycastle.asn1.x509.Extensions b;

    public X509CertificateHolder(org.bouncycastle.asn1.x509.Certificate certificate) {
        g(certificate);
    }

    private void g(org.bouncycastle.asn1.x509.Certificate certificate) {
        this.a = certificate;
        this.b = certificate.x().o();
    }

    private static org.bouncycastle.asn1.x509.Certificate h(byte[] bArr) throws org.bouncycastle.cert.CertIOException {
        try {
            return org.bouncycastle.asn1.x509.Certificate.o(org.bouncycastle.cert.CertUtils.a(bArr));
        } catch (java.lang.ClassCastException e) {
            throw new org.bouncycastle.cert.CertIOException("malformed data: " + e.getMessage(), e);
        } catch (java.lang.IllegalArgumentException e2) {
            throw new org.bouncycastle.cert.CertIOException("malformed data: " + e2.getMessage(), e2);
        }
    }

    private void readObject(java.io.ObjectInputStream objectInputStream) throws java.lang.ClassNotFoundException, java.io.IOException {
        objectInputStream.defaultReadObject();
        g(org.bouncycastle.asn1.x509.Certificate.o(objectInputStream.readObject()));
    }

    private void writeObject(java.io.ObjectOutputStream objectOutputStream) throws java.io.IOException {
        objectOutputStream.defaultWriteObject();
        objectOutputStream.writeObject(getEncoded());
    }

    public org.bouncycastle.asn1.x509.Extension a(org.bouncycastle.asn1.ASN1ObjectIdentifier aSN1ObjectIdentifier) {
        org.bouncycastle.asn1.x509.Extensions extensions = this.b;
        if (extensions != null) {
            return extensions.n(aSN1ObjectIdentifier);
        }
        return null;
    }

    public org.bouncycastle.asn1.x509.Extensions b() {
        return this.b;
    }

    public org.bouncycastle.asn1.x500.X500Name c() {
        return org.bouncycastle.asn1.x500.X500Name.n(this.a.q());
    }

    public java.math.BigInteger d() {
        return this.a.r().B();
    }

    public org.bouncycastle.asn1.x500.X500Name e() {
        return org.bouncycastle.asn1.x500.X500Name.n(this.a.v());
    }

    public boolean equals(java.lang.Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof org.bouncycastle.cert.X509CertificateHolder) {
            return this.a.equals(((org.bouncycastle.cert.X509CertificateHolder) obj).a);
        }
        return false;
    }

    public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo f() {
        return this.a.w();
    }

    public byte[] getEncoded() {
        return this.a.getEncoded();
    }

    public int hashCode() {
        return this.a.hashCode();
    }

    public org.bouncycastle.asn1.x509.Certificate i() {
        return this.a;
    }

    public X509CertificateHolder(byte[] bArr) {
        this(h(bArr));
    }
}
