what-the-bank/sources/org/bouncycastle/asn1/cryptopro/GOST3410ParamSetParameters....

81 lines
2.7 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.cryptopro;
import java.math.BigInteger;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
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;
/* loaded from: classes6.dex */
public class GOST3410ParamSetParameters extends ASN1Object {
ASN1Integer a;
int keySize;
ASN1Integer p;
ASN1Integer q;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(new ASN1Integer(this.keySize));
aSN1EncodableVector.add(this.p);
aSN1EncodableVector.add(this.q);
aSN1EncodableVector.add(this.a);
return new DERSequence(aSN1EncodableVector);
}
public BigInteger getQ() {
return this.q.getPositiveValue();
}
public BigInteger getP() {
return this.p.getPositiveValue();
}
public int getLKeySize() {
return this.keySize;
}
public int getKeySize() {
return this.keySize;
}
public BigInteger getA() {
return this.a.getPositiveValue();
}
public static GOST3410ParamSetParameters getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) {
return getInstance(ASN1Sequence.getInstance(aSN1TaggedObject, z));
}
public static GOST3410ParamSetParameters getInstance(Object obj) {
if (obj == null || (obj instanceof GOST3410ParamSetParameters)) {
return (GOST3410ParamSetParameters) obj;
}
if (obj instanceof ASN1Sequence) {
return new GOST3410ParamSetParameters((ASN1Sequence) obj);
}
StringBuilder sb = new StringBuilder("Invalid GOST3410Parameter: ");
sb.append(obj.getClass().getName());
throw new IllegalArgumentException(sb.toString());
}
public GOST3410ParamSetParameters(ASN1Sequence aSN1Sequence) {
Enumeration objects = aSN1Sequence.getObjects();
this.keySize = ((ASN1Integer) objects.nextElement()).getValue().intValue();
this.p = (ASN1Integer) objects.nextElement();
this.q = (ASN1Integer) objects.nextElement();
this.a = (ASN1Integer) objects.nextElement();
}
public GOST3410ParamSetParameters(int i, BigInteger bigInteger, BigInteger bigInteger2, BigInteger bigInteger3) {
this.keySize = i;
this.p = new ASN1Integer(bigInteger);
this.q = new ASN1Integer(bigInteger2);
this.a = new ASN1Integer(bigInteger3);
}
}