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

64 lines
2.1 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.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
/* loaded from: classes6.dex */
public class OcspResponsesID extends ASN1Object {
private OcspIdentifier ocspIdentifier;
private OtherHash ocspRepHash;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.ocspIdentifier);
OtherHash otherHash = this.ocspRepHash;
if (otherHash != null) {
aSN1EncodableVector.add(otherHash);
}
return new DERSequence(aSN1EncodableVector);
}
public OtherHash getOcspRepHash() {
return this.ocspRepHash;
}
public OcspIdentifier getOcspIdentifier() {
return this.ocspIdentifier;
}
public static OcspResponsesID getInstance(Object obj) {
if (obj instanceof OcspResponsesID) {
return (OcspResponsesID) obj;
}
if (obj != null) {
return new OcspResponsesID(ASN1Sequence.getInstance(obj));
}
return null;
}
public OcspResponsesID(OcspIdentifier ocspIdentifier, OtherHash otherHash) {
this.ocspIdentifier = ocspIdentifier;
this.ocspRepHash = otherHash;
}
public OcspResponsesID(OcspIdentifier ocspIdentifier) {
this(ocspIdentifier, null);
}
private OcspResponsesID(ASN1Sequence aSN1Sequence) {
if (aSN1Sequence.size() <= 0 || aSN1Sequence.size() > 2) {
StringBuilder sb = new StringBuilder("Bad sequence size: ");
sb.append(aSN1Sequence.size());
throw new IllegalArgumentException(sb.toString());
}
this.ocspIdentifier = OcspIdentifier.getInstance(aSN1Sequence.getObjectAt(0));
if (aSN1Sequence.size() > 1) {
this.ocspRepHash = OtherHash.getInstance(aSN1Sequence.getObjectAt(1));
}
}
}