what-the-bank/sources/org/bouncycastle/asn1/x9/DHValidationParms.java

69 lines
2.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.x9;
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.DERBitString;
import org.bouncycastle.asn1.DERSequence;
/* loaded from: classes6.dex */
public class DHValidationParms extends ASN1Object {
private ASN1Integer pgenCounter;
private DERBitString seed;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.seed);
aSN1EncodableVector.add(this.pgenCounter);
return new DERSequence(aSN1EncodableVector);
}
public DERBitString getSeed() {
return this.seed;
}
public ASN1Integer getPgenCounter() {
return this.pgenCounter;
}
public static DHValidationParms getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) {
return getInstance(ASN1Sequence.getInstance(aSN1TaggedObject, z));
}
public static DHValidationParms getInstance(Object obj) {
if (obj instanceof DHValidationParms) {
return (DHValidationParms) obj;
}
if (obj != null) {
return new DHValidationParms(ASN1Sequence.getInstance(obj));
}
return null;
}
public DHValidationParms(DERBitString dERBitString, ASN1Integer aSN1Integer) {
if (dERBitString == null) {
throw new IllegalArgumentException("'seed' cannot be null");
}
if (aSN1Integer == null) {
throw new IllegalArgumentException("'pgenCounter' cannot be null");
}
this.seed = dERBitString;
this.pgenCounter = aSN1Integer;
}
private DHValidationParms(ASN1Sequence aSN1Sequence) {
if (aSN1Sequence.size() == 2) {
this.seed = DERBitString.getInstance(aSN1Sequence.getObjectAt(0));
this.pgenCounter = ASN1Integer.getInstance(aSN1Sequence.getObjectAt(1));
} else {
StringBuilder sb = new StringBuilder("Bad sequence size: ");
sb.append(aSN1Sequence.size());
throw new IllegalArgumentException(sb.toString());
}
}
}