public static ECPrivateKey getEcPrivateKey(CurveType curve, final byte[] keyValue)
      throws GeneralSecurityException {
    ECParameterSpec ecParams = getCurveSpec(curve);
    BigInteger privValue = BigIntegerEncoding.fromUnsignedBigEndianBytes(keyValue);
    ECPrivateKeySpec spec = new ECPrivateKeySpec(privValue, ecParams);
    KeyFactory kf = EngineFactory.KEY_FACTORY.getInstance("EC");
    return (ECPrivateKey) kf.generatePrivate(spec);
  }
Returns an {@code ECPrivateKey} from {@code curve} type and {@code keyValue}.
java_src/src/main/java/com/google/crypto/tink/subtle/EllipticCurves.java