33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package org.bouncycastle.jcajce.provider.asymmetric.ec;
|
|
|
|
import java.security.spec.ECGenParameterSpec;
|
|
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
|
|
import org.bouncycastle.asn1.x9.X9ECParameters;
|
|
import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil;
|
|
|
|
/* loaded from: classes6.dex */
|
|
class ECUtils {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X9ECParameters getDomainParametersFromName(String str) {
|
|
try {
|
|
if (str.charAt(0) >= '0' && str.charAt(0) <= '2') {
|
|
return ECUtil.getNamedCurveByOid(new ASN1ObjectIdentifier(str));
|
|
}
|
|
if (str.indexOf(32) > 0) {
|
|
str = str.substring(str.indexOf(32) + 1);
|
|
}
|
|
return ECUtil.getNamedCurveByName(str);
|
|
} catch (IllegalArgumentException unused) {
|
|
return ECUtil.getNamedCurveByName(str);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X9ECParameters getDomainParametersFromGenSpec(ECGenParameterSpec eCGenParameterSpec) {
|
|
return getDomainParametersFromName(eCGenParameterSpec.getName());
|
|
}
|
|
|
|
ECUtils() {
|
|
}
|
|
}
|