public static KeyPair generateKeyPair(ECParameterSpec spec) throws GeneralSecurityException {
    KeyPairGenerator keyGen = EngineFactory.KEY_PAIR_GENERATOR.getInstance("EC");
    keyGen.initialize(spec);
    return keyGen.generateKeyPair();
  }
Generates a new key pair for {@code spec}.
java_src/src/main/java/com/google/crypto/tink/subtle/EllipticCurves.java