what-the-bank/sources/org/bouncycastle/asn1/esf/CrlOcspRef.java

79 lines
2.7 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.esf;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERTaggedObject;
/* loaded from: classes6.dex */
public class CrlOcspRef extends ASN1Object {
private CrlListID crlids;
private OcspListID ocspids;
private OtherRevRefs otherRev;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
if (this.crlids != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 0, this.crlids.toASN1Primitive()));
}
if (this.ocspids != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 1, this.ocspids.toASN1Primitive()));
}
if (this.otherRev != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 2, this.otherRev.toASN1Primitive()));
}
return new DERSequence(aSN1EncodableVector);
}
public OtherRevRefs getOtherRev() {
return this.otherRev;
}
public OcspListID getOcspids() {
return this.ocspids;
}
public CrlListID getCrlids() {
return this.crlids;
}
public static CrlOcspRef getInstance(Object obj) {
if (obj instanceof CrlOcspRef) {
return (CrlOcspRef) obj;
}
if (obj != null) {
return new CrlOcspRef(ASN1Sequence.getInstance(obj));
}
return null;
}
public CrlOcspRef(CrlListID crlListID, OcspListID ocspListID, OtherRevRefs otherRevRefs) {
this.crlids = crlListID;
this.ocspids = ocspListID;
this.otherRev = otherRevRefs;
}
private CrlOcspRef(ASN1Sequence aSN1Sequence) {
Enumeration objects = aSN1Sequence.getObjects();
while (objects.hasMoreElements()) {
ASN1TaggedObject aSN1TaggedObject = (ASN1TaggedObject) objects.nextElement();
int tagNo = aSN1TaggedObject.getTagNo();
if (tagNo == 0) {
this.crlids = CrlListID.getInstance(aSN1TaggedObject.getObject());
} else if (tagNo == 1) {
this.ocspids = OcspListID.getInstance(aSN1TaggedObject.getObject());
} else {
if (tagNo != 2) {
throw new IllegalArgumentException("illegal tag");
}
this.otherRev = OtherRevRefs.getInstance(aSN1TaggedObject.getObject());
}
}
}
}