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

83 lines
3.0 KiB
Java

package org.bouncycastle.asn1.x9;
import java.util.Enumeration;
import java.util.Vector;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.anssi.ANSSINamedCurves;
import org.bouncycastle.asn1.cryptopro.ECGOST3410NamedCurves;
import org.bouncycastle.asn1.nist.NISTNamedCurves;
import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.teletrust.TeleTrusTNamedCurves;
/* loaded from: classes6.dex */
public class ECNamedCurveTable {
public static ASN1ObjectIdentifier getOID(String str) {
ASN1ObjectIdentifier oid = X962NamedCurves.getOID(str);
if (oid == null) {
oid = SECNamedCurves.getOID(str);
}
if (oid == null) {
oid = NISTNamedCurves.getOID(str);
}
if (oid == null) {
oid = TeleTrusTNamedCurves.getOID(str);
}
return oid == null ? ANSSINamedCurves.getOID(str) : oid;
}
public static Enumeration getNames() {
Vector vector = new Vector();
addEnumeration(vector, X962NamedCurves.getNames());
addEnumeration(vector, SECNamedCurves.getNames());
addEnumeration(vector, NISTNamedCurves.getNames());
addEnumeration(vector, TeleTrusTNamedCurves.getNames());
addEnumeration(vector, ANSSINamedCurves.getNames());
return vector.elements();
}
public static String getName(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
String name = NISTNamedCurves.getName(aSN1ObjectIdentifier);
if (name == null) {
name = SECNamedCurves.getName(aSN1ObjectIdentifier);
}
if (name == null) {
name = TeleTrusTNamedCurves.getName(aSN1ObjectIdentifier);
}
if (name == null) {
name = X962NamedCurves.getName(aSN1ObjectIdentifier);
}
return name == null ? ECGOST3410NamedCurves.getName(aSN1ObjectIdentifier) : name;
}
public static X9ECParameters getByOID(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
X9ECParameters byOID = X962NamedCurves.getByOID(aSN1ObjectIdentifier);
if (byOID == null) {
byOID = SECNamedCurves.getByOID(aSN1ObjectIdentifier);
}
if (byOID == null) {
byOID = TeleTrusTNamedCurves.getByOID(aSN1ObjectIdentifier);
}
return byOID == null ? ANSSINamedCurves.getByOID(aSN1ObjectIdentifier) : byOID;
}
public static X9ECParameters getByName(String str) {
X9ECParameters byName = X962NamedCurves.getByName(str);
if (byName == null) {
byName = SECNamedCurves.getByName(str);
}
if (byName == null) {
byName = NISTNamedCurves.getByName(str);
}
if (byName == null) {
byName = TeleTrusTNamedCurves.getByName(str);
}
return byName == null ? ANSSINamedCurves.getByName(str) : byName;
}
private static void addEnumeration(Vector vector, Enumeration enumeration) {
while (enumeration.hasMoreElements()) {
vector.addElement(enumeration.nextElement());
}
}
}