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

60 lines
2.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.ocsp;
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 OCSPResponse extends ASN1Object {
ResponseBytes responseBytes;
OCSPResponseStatus responseStatus;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.responseStatus);
if (this.responseBytes != null) {
aSN1EncodableVector.add(new DERTaggedObject(true, 0, this.responseBytes));
}
return new DERSequence(aSN1EncodableVector);
}
public OCSPResponseStatus getResponseStatus() {
return this.responseStatus;
}
public ResponseBytes getResponseBytes() {
return this.responseBytes;
}
public static OCSPResponse getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) {
return getInstance(ASN1Sequence.getInstance(aSN1TaggedObject, z));
}
public static OCSPResponse getInstance(Object obj) {
if (obj instanceof OCSPResponse) {
return (OCSPResponse) obj;
}
if (obj != null) {
return new OCSPResponse(ASN1Sequence.getInstance(obj));
}
return null;
}
public OCSPResponse(OCSPResponseStatus oCSPResponseStatus, ResponseBytes responseBytes) {
this.responseStatus = oCSPResponseStatus;
this.responseBytes = responseBytes;
}
private OCSPResponse(ASN1Sequence aSN1Sequence) {
this.responseStatus = OCSPResponseStatus.getInstance(aSN1Sequence.getObjectAt(0));
if (aSN1Sequence.size() == 2) {
this.responseBytes = ResponseBytes.getInstance((ASN1TaggedObject) aSN1Sequence.getObjectAt(1), true);
}
}
}