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

58 lines
2.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.esf;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.ocsp.ResponderID;
/* loaded from: classes6.dex */
public class OcspIdentifier extends ASN1Object {
private ResponderID ocspResponderID;
private ASN1GeneralizedTime producedAt;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.ocspResponderID);
aSN1EncodableVector.add(this.producedAt);
return new DERSequence(aSN1EncodableVector);
}
public ASN1GeneralizedTime getProducedAt() {
return this.producedAt;
}
public ResponderID getOcspResponderID() {
return this.ocspResponderID;
}
public static OcspIdentifier getInstance(Object obj) {
if (obj instanceof OcspIdentifier) {
return (OcspIdentifier) obj;
}
if (obj != null) {
return new OcspIdentifier(ASN1Sequence.getInstance(obj));
}
return null;
}
public OcspIdentifier(ResponderID responderID, ASN1GeneralizedTime aSN1GeneralizedTime) {
this.ocspResponderID = responderID;
this.producedAt = aSN1GeneralizedTime;
}
private OcspIdentifier(ASN1Sequence aSN1Sequence) {
if (aSN1Sequence.size() == 2) {
this.ocspResponderID = ResponderID.getInstance(aSN1Sequence.getObjectAt(0));
this.producedAt = (ASN1GeneralizedTime) aSN1Sequence.getObjectAt(1);
} else {
StringBuilder sb = new StringBuilder("Bad sequence size: ");
sb.append(aSN1Sequence.size());
throw new IllegalArgumentException(sb.toString());
}
}
}