what-the-bank/sources/org/bouncycastle/asn1/esf/OtherHashAlgAndValue.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.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
/* loaded from: classes6.dex */
public class OtherHashAlgAndValue extends ASN1Object {
private AlgorithmIdentifier hashAlgorithm;
private ASN1OctetString hashValue;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.hashAlgorithm);
aSN1EncodableVector.add(this.hashValue);
return new DERSequence(aSN1EncodableVector);
}
public ASN1OctetString getHashValue() {
return this.hashValue;
}
public AlgorithmIdentifier getHashAlgorithm() {
return this.hashAlgorithm;
}
public static OtherHashAlgAndValue getInstance(Object obj) {
if (obj instanceof OtherHashAlgAndValue) {
return (OtherHashAlgAndValue) obj;
}
if (obj != null) {
return new OtherHashAlgAndValue(ASN1Sequence.getInstance(obj));
}
return null;
}
public OtherHashAlgAndValue(AlgorithmIdentifier algorithmIdentifier, ASN1OctetString aSN1OctetString) {
this.hashAlgorithm = algorithmIdentifier;
this.hashValue = aSN1OctetString;
}
private OtherHashAlgAndValue(ASN1Sequence aSN1Sequence) {
if (aSN1Sequence.size() == 2) {
this.hashAlgorithm = AlgorithmIdentifier.getInstance(aSN1Sequence.getObjectAt(0));
this.hashValue = ASN1OctetString.getInstance(aSN1Sequence.getObjectAt(1));
} else {
StringBuilder sb = new StringBuilder("Bad sequence size: ");
sb.append(aSN1Sequence.size());
throw new IllegalArgumentException(sb.toString());
}
}
}