package org.bouncycastle.asn1.ocsp; import org.bouncycastle.asn1.ASN1Choice; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1Object; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.ASN1TaggedObject; import org.bouncycastle.asn1.DERNull; import org.bouncycastle.asn1.DERTaggedObject; /* loaded from: classes6.dex */ public class CertStatus extends ASN1Object implements ASN1Choice { private int tagNo; private ASN1Encodable value; @Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable public ASN1Primitive toASN1Primitive() { return new DERTaggedObject(false, this.tagNo, this.value); } public int getTagNo() { return this.tagNo; } public ASN1Encodable getStatus() { return this.value; } public static CertStatus getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) { return getInstance(aSN1TaggedObject.getObject()); } public static CertStatus getInstance(Object obj) { if (obj == null || (obj instanceof CertStatus)) { return (CertStatus) obj; } if (obj instanceof ASN1TaggedObject) { return new CertStatus((ASN1TaggedObject) obj); } StringBuilder sb = new StringBuilder("unknown object in factory: "); sb.append(obj.getClass().getName()); throw new IllegalArgumentException(sb.toString()); } public CertStatus(RevokedInfo revokedInfo) { this.tagNo = 1; this.value = revokedInfo; } private CertStatus(ASN1TaggedObject aSN1TaggedObject) { ASN1Encodable aSN1Encodable; this.tagNo = aSN1TaggedObject.getTagNo(); int tagNo = aSN1TaggedObject.getTagNo(); if (tagNo == 0) { aSN1Encodable = DERNull.INSTANCE; } else { if (tagNo != 1) { if (tagNo == 2) { this.value = DERNull.INSTANCE; } StringBuilder sb = new StringBuilder("Unknown tag encountered: "); sb.append(aSN1TaggedObject.getTagNo()); throw new IllegalArgumentException(sb.toString()); } aSN1Encodable = RevokedInfo.getInstance(aSN1TaggedObject, false); } this.value = aSN1Encodable; } public CertStatus(int i, ASN1Encodable aSN1Encodable) { this.tagNo = i; this.value = aSN1Encodable; } public CertStatus() { this.tagNo = 0; this.value = DERNull.INSTANCE; } }