package h2;

import g2.c;
import g2.e;
import g2.k;
import g2.m;
import g2.s;
import g2.t;
import g2.z0;

/* JADX INFO: compiled from: BasicConstraints.java */
/* JADX INFO: loaded from: classes.dex */
public class a extends m {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    c f4814e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    k f4815f;

    private a(t tVar) {
        this.f4814e = c.r(false);
        this.f4815f = null;
        if (tVar.size() == 0) {
            this.f4814e = null;
            this.f4815f = null;
            return;
        }
        if (tVar.q(0) instanceof c) {
            this.f4814e = c.q(tVar.q(0));
        } else {
            this.f4814e = null;
            this.f4815f = k.p(tVar.q(0));
        }
        if (tVar.size() > 1) {
            if (this.f4814e == null) {
                throw new IllegalArgumentException("wrong sequence in constructor");
            }
            this.f4815f = k.p(tVar.q(1));
        }
    }

    public static a h(Object obj) {
        if (obj instanceof a) {
            return (a) obj;
        }
        if (obj instanceof b) {
            return h(b.a((b) obj));
        }
        if (obj != null) {
            return new a(t.p(obj));
        }
        return null;
    }

    @Override // g2.m, g2.d
    public s c() {
        e eVar = new e(2);
        c cVar = this.f4814e;
        if (cVar != null) {
            eVar.a(cVar);
        }
        k kVar = this.f4815f;
        if (kVar != null) {
            eVar.a(kVar);
        }
        return new z0(eVar);
    }

    public boolean i() {
        c cVar = this.f4814e;
        return cVar != null && cVar.s();
    }

    public String toString() {
        if (this.f4815f == null) {
            return "BasicConstraints: isCa(" + i() + ")";
        }
        return "BasicConstraints: isCa(" + i() + "), pathLenConstraint = " + this.f4815f.q();
    }
}
