what-the-bank/sources/org/bouncycastle/asn1/ocsp/CrlID.java

78 lines
2.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.ocsp;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERIA5String;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERTaggedObject;
/* loaded from: classes6.dex */
public class CrlID extends ASN1Object {
private ASN1Integer crlNum;
private ASN1GeneralizedTime crlTime;
private DERIA5String crlUrl;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
if (this.crlUrl != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 0, this.crlUrl));
}
if (this.crlNum != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 1, this.crlNum));
}
if (this.crlTime != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 2, this.crlTime));
}
return new DERSequence(aSN1EncodableVector);
}
public DERIA5String getCrlUrl() {
return this.crlUrl;
}
public ASN1GeneralizedTime getCrlTime() {
return this.crlTime;
}
public ASN1Integer getCrlNum() {
return this.crlNum;
}
public static CrlID getInstance(Object obj) {
if (obj instanceof CrlID) {
return (CrlID) obj;
}
if (obj != null) {
return new CrlID(ASN1Sequence.getInstance(obj));
}
return null;
}
private CrlID(ASN1Sequence aSN1Sequence) {
Enumeration objects = aSN1Sequence.getObjects();
while (objects.hasMoreElements()) {
ASN1TaggedObject aSN1TaggedObject = (ASN1TaggedObject) objects.nextElement();
int tagNo = aSN1TaggedObject.getTagNo();
if (tagNo == 0) {
this.crlUrl = DERIA5String.getInstance(aSN1TaggedObject, true);
} else if (tagNo == 1) {
this.crlNum = ASN1Integer.getInstance(aSN1TaggedObject, true);
} else {
if (tagNo != 2) {
StringBuilder sb = new StringBuilder("unknown tag number: ");
sb.append(aSN1TaggedObject.getTagNo());
throw new IllegalArgumentException(sb.toString());
}
this.crlTime = ASN1GeneralizedTime.getInstance(aSN1TaggedObject, true);
}
}
}
}