package org.bouncycastle.asn1.cms;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class CMSAlgorithmProtection extends org.bouncycastle.asn1.ASN1Object {
    private final org.bouncycastle.asn1.x509.AlgorithmIdentifier a;
    private final org.bouncycastle.asn1.x509.AlgorithmIdentifier b;
    private final org.bouncycastle.asn1.x509.AlgorithmIdentifier c;

    public CMSAlgorithmProtection(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, int i, org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier2) {
        if (algorithmIdentifier == null || algorithmIdentifier2 == null) {
            throw new java.lang.NullPointerException("AlgorithmIdentifiers cannot be null");
        }
        this.a = algorithmIdentifier;
        if (i == 1) {
            this.b = algorithmIdentifier2;
            this.c = null;
        } else if (i == 2) {
            this.b = null;
            this.c = algorithmIdentifier2;
        } else {
            throw new java.lang.IllegalArgumentException("Unknown type: " + i);
        }
    }

    @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);
        org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier = this.b;
        if (algorithmIdentifier != null) {
            aSN1EncodableVector.a(new org.bouncycastle.asn1.DERTaggedObject(false, 1, algorithmIdentifier));
        }
        org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier2 = this.c;
        if (algorithmIdentifier2 != null) {
            aSN1EncodableVector.a(new org.bouncycastle.asn1.DERTaggedObject(false, 2, algorithmIdentifier2));
        }
        return new org.bouncycastle.asn1.DERSequence(aSN1EncodableVector);
    }
}
