package org.bouncycastle.asn1.pkcs;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class PBES2Parameters extends org.bouncycastle.asn1.ASN1Object implements org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers {
    private org.bouncycastle.asn1.pkcs.KeyDerivationFunc a;
    private org.bouncycastle.asn1.pkcs.EncryptionScheme b;

    private PBES2Parameters(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        java.util.Enumeration enumerationC = aSN1Sequence.C();
        org.bouncycastle.asn1.ASN1Sequence aSN1SequenceZ = org.bouncycastle.asn1.ASN1Sequence.z(((org.bouncycastle.asn1.ASN1Encodable) enumerationC.nextElement()).j());
        org.bouncycastle.asn1.ASN1Encodable aSN1EncodableB = aSN1SequenceZ.B(0);
        org.bouncycastle.asn1.ASN1ObjectIdentifier aSN1ObjectIdentifier = org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers.x1;
        if (aSN1EncodableB.equals(aSN1ObjectIdentifier)) {
            this.a = new org.bouncycastle.asn1.pkcs.KeyDerivationFunc(aSN1ObjectIdentifier, org.bouncycastle.asn1.pkcs.PBKDF2Params.n(aSN1SequenceZ.B(1)));
        } else {
            this.a = org.bouncycastle.asn1.pkcs.KeyDerivationFunc.o(aSN1SequenceZ);
        }
        this.b = org.bouncycastle.asn1.pkcs.EncryptionScheme.o(enumerationC.nextElement());
    }

    public static org.bouncycastle.asn1.pkcs.PBES2Parameters o(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.pkcs.PBES2Parameters) {
            return (org.bouncycastle.asn1.pkcs.PBES2Parameters) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.pkcs.PBES2Parameters(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.pkcs.EncryptionScheme n() {
        return this.b;
    }

    public org.bouncycastle.asn1.pkcs.KeyDerivationFunc p() {
        return this.a;
    }

    public PBES2Parameters(org.bouncycastle.asn1.pkcs.KeyDerivationFunc keyDerivationFunc, org.bouncycastle.asn1.pkcs.EncryptionScheme encryptionScheme) {
        this.a = keyDerivationFunc;
        this.b = encryptionScheme;
    }
}
