package org.bouncycastle.asn1.pkcs;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class DHParameter extends org.bouncycastle.asn1.ASN1Object {
    org.bouncycastle.asn1.ASN1Integer a;
    org.bouncycastle.asn1.ASN1Integer b;
    org.bouncycastle.asn1.ASN1Integer c;

    public DHParameter(java.math.BigInteger bigInteger, java.math.BigInteger bigInteger2, int i) {
        this.a = new org.bouncycastle.asn1.ASN1Integer(bigInteger);
        this.b = new org.bouncycastle.asn1.ASN1Integer(bigInteger2);
        this.c = i != 0 ? new org.bouncycastle.asn1.ASN1Integer(i) : null;
    }

    public static org.bouncycastle.asn1.pkcs.DHParameter o(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.pkcs.DHParameter) {
            return (org.bouncycastle.asn1.pkcs.DHParameter) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.pkcs.DHParameter(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);
        aSN1EncodableVector.a(this.b);
        if (p() != null) {
            aSN1EncodableVector.a(this.c);
        }
        return new org.bouncycastle.asn1.DERSequence(aSN1EncodableVector);
    }

    public java.math.BigInteger n() {
        return this.b.A();
    }

    public java.math.BigInteger p() {
        org.bouncycastle.asn1.ASN1Integer aSN1Integer = this.c;
        if (aSN1Integer == null) {
            return null;
        }
        return aSN1Integer.A();
    }

    public java.math.BigInteger q() {
        return this.a.A();
    }

    private DHParameter(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        java.util.Enumeration enumerationC = aSN1Sequence.C();
        this.a = org.bouncycastle.asn1.ASN1Integer.y(enumerationC.nextElement());
        this.b = org.bouncycastle.asn1.ASN1Integer.y(enumerationC.nextElement());
        this.c = enumerationC.hasMoreElements() ? (org.bouncycastle.asn1.ASN1Integer) enumerationC.nextElement() : null;
    }
}
