package org.bouncycastle.asn1.pkcs;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
public class AuthenticatedSafe extends org.bouncycastle.asn1.ASN1Object {
    private org.bouncycastle.asn1.pkcs.ContentInfo[] a;
    private boolean b;

    private AuthenticatedSafe(org.bouncycastle.asn1.ASN1Sequence aSN1Sequence) {
        this.b = true;
        this.a = new org.bouncycastle.asn1.pkcs.ContentInfo[aSN1Sequence.size()];
        int i = 0;
        while (true) {
            org.bouncycastle.asn1.pkcs.ContentInfo[] contentInfoArr = this.a;
            if (i == contentInfoArr.length) {
                this.b = aSN1Sequence instanceof org.bouncycastle.asn1.BERSequence;
                return;
            } else {
                contentInfoArr[i] = org.bouncycastle.asn1.pkcs.ContentInfo.p(aSN1Sequence.B(i));
                i++;
            }
        }
    }

    private org.bouncycastle.asn1.pkcs.ContentInfo[] n(org.bouncycastle.asn1.pkcs.ContentInfo[] contentInfoArr) {
        int length = contentInfoArr.length;
        org.bouncycastle.asn1.pkcs.ContentInfo[] contentInfoArr2 = new org.bouncycastle.asn1.pkcs.ContentInfo[length];
        java.lang.System.arraycopy(contentInfoArr, 0, contentInfoArr2, 0, length);
        return contentInfoArr2;
    }

    public static org.bouncycastle.asn1.pkcs.AuthenticatedSafe p(java.lang.Object obj) {
        if (obj instanceof org.bouncycastle.asn1.pkcs.AuthenticatedSafe) {
            return (org.bouncycastle.asn1.pkcs.AuthenticatedSafe) obj;
        }
        if (obj != null) {
            return new org.bouncycastle.asn1.pkcs.AuthenticatedSafe(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 ? new org.bouncycastle.asn1.BERSequence(this.a) : new org.bouncycastle.asn1.DLSequence(this.a);
    }

    public org.bouncycastle.asn1.pkcs.ContentInfo[] o() {
        return n(this.a);
    }

    public AuthenticatedSafe(org.bouncycastle.asn1.pkcs.ContentInfo[] contentInfoArr) {
        this.b = true;
        this.a = n(contentInfoArr);
    }
}
