ecParam = ECNamedCurveTable.getByOID(ecOID); if (ecParam == null) { throw new PEMException("Unable to find EC Parameter for the given curve oid: "
X9ECParameters params = ECNamedCurveTable.getByName(lcurveName);
public static ASN1ObjectIdentifier getNamedCurveOid( ECParameterSpec ecParameterSpec) { for (Enumeration names = ECNamedCurveTable.getNames(); names.hasMoreElements();) { String name = (String)names.nextElement(); X9ECParameters params = ECNamedCurveTable.getByName(name); if (params.getN().equals(ecParameterSpec.getN()) && params.getH().equals(ecParameterSpec.getH()) && params.getCurve().equals(ecParameterSpec.getCurve()) && params.getG().equals(ecParameterSpec.getG())) { return org.bouncycastle.asn1.x9.ECNamedCurveTable.getOID(name); } } return null; }
public static void main(String[] args) { SortedSet names = new TreeSet(enumToList(ECNamedCurveTable.getNames())); names.addAll(enumToList(CustomNamedCurves.getNames())); Iterator it = names.iterator(); while (it.hasNext()) { String name = (String)it.next(); X9ECParameters x9 = CustomNamedCurves.getByName(name); if (x9 == null) { x9 = ECNamedCurveTable.getByName(name); } if (x9 != null && ECAlgorithms.isF2mCurve(x9.getCurve())) { System.out.print(name + ":"); implPrintRootZ(x9); } } }
public static ASN1ObjectIdentifier getNamedCurveOid( String curveName) { String name = curveName; int spacePos = name.indexOf(' '); if (spacePos > 0) { name = name.substring(spacePos + 1); } try { if (name.charAt(0) >= '0' && name.charAt(0) <= '2') { return new ASN1ObjectIdentifier(name); } } catch (IllegalArgumentException ex) { } return ECNamedCurveTable.getOID(name); }
public static String getCurveName( ASN1ObjectIdentifier oid) { return ECNamedCurveTable.getName(oid); }
/** * return an enumeration of the names of the available curves. * * @return an enumeration of the names of the available curves. */ public static Enumeration getNames() { Vector v = new Vector(); addEnumeration(v, X962NamedCurves.getNames()); addEnumeration(v, SECNamedCurves.getNames()); addEnumeration(v, NISTNamedCurves.getNames()); addEnumeration(v, TeleTrusTNamedCurves.getNames()); return v.elements(); }
ecP = fromDomainParameters(ECGOST3410NamedCurves.getByOID(oid));
public static void main(String[] args) { SortedSet names = new TreeSet(enumToList(ECNamedCurveTable.getNames())); names.addAll(enumToList(CustomNamedCurves.getNames())); Iterator it = names.iterator(); while (it.hasNext()) { String name = (String)it.next(); X9ECParameters x9 = CustomNamedCurves.getByName(name); if (x9 == null) { x9 = ECNamedCurveTable.getByName(name); } if (x9 != null && ECAlgorithms.isF2mCurve(x9.getCurve())) { System.out.print(name + ":"); implPrintNonZeroTraceBits(x9); } } }
private static RFC6637 create( String curveName, Supplier<Digest> digestFactory, Supplier<Wrapper> wrapperFactory, int publicKeyAlgID, int symAlgID, int symAlgIDLength, int kdfHashID) { try { ASN1ObjectIdentifier oid = ECNamedCurveTable.getOID(curveName); RFC6637KDF kdf = new RFC6637KDF( digestFactory, oid, (byte) publicKeyAlgID, (byte) symAlgID, (byte) kdfHashID); return new RFC6637(wrapperFactory, curveName, symAlgIDLength, kdf); } catch (IOException ex) { throw new IllegalStateException(ex); } }
@Override protected void engineInit(byte[] bytes, String format) throws IOException { if (isASN1FormatString(format)) { X962Parameters params = X962Parameters.getInstance(bytes); ECCurve curve = EC5Util.getCurve(BouncyCastleProvider.CONFIGURATION, params); if (params.isNamedCurve()) { ASN1ObjectIdentifier curveId = ASN1ObjectIdentifier.getInstance(params.getParameters()); curveName = ECNamedCurveTable.getName(curveId); if (curveName == null) { curveName = curveId.getId(); } } ecParameterSpec = EC5Util.convertToSpec(params, curve); } else { throw new IOException("Unknown encoded parameters format in AlgorithmParameters object: " + format); } }
/** * return an enumeration of the names of the available curves. * * @return an enumeration of the names of the available curves. */ public static Enumeration getNames() { Vector v = new Vector(); addEnumeration(v, X962NamedCurves.getNames()); addEnumeration(v, SECNamedCurves.getNames()); addEnumeration(v, NISTNamedCurves.getNames()); addEnumeration(v, TeleTrusTNamedCurves.getNames()); addEnumeration(v, ANSSINamedCurves.getNames()); addEnumeration(v, ECGOST3410NamedCurves.getNames()); addEnumeration(v, GMNamedCurves.getNames()); return v.elements(); }
ecP = fromDomainParameters(ECGOST3410NamedCurves.getByName(name));
ecParam = ECNamedCurveTable.getByOID(ecOID); if (ecParam == null) { throw new PEMException("Unable to find EC Parameter for the given curve oid: " + ecOID.getId());
X9ECParameters params = ECNamedCurveTable.getByName(curveName); BigInteger curveN = params.getN();
return new ECPrivateKeyParameters( k.getD(), new ECNamedDomainParameters(ECNamedCurveTable.getOID(name), s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
public static X9ECParameters getNamedCurveByOid( ASN1ObjectIdentifier oid) { X9ECParameters params = CustomNamedCurves.getByOID(oid); if (params == null) { params = ECNamedCurveTable.getByOID(oid); } return params; }
public static X9ECParameters x9ECParameters(String curveName) { X9ECParameters x9ECParameters = ECNamedCurveTable.getByName(curveName); if (x9ECParameters == null) { throw new IllegalArgumentException("unsupported elliptic curve: " + curveName); } return x9ECParameters; }
encodedParams = curveOid.getEncoded(); } else { encodedParams = ECNamedCurveTable.getByOID(curveOid).getEncoded();