@AccessesPartialKey
  private static EcdsaPrivateKey createKey(
      EcdsaParameters parameters, @Nullable Integer idRequirement) throws GeneralSecurityException {
    KeyPair keyPair = EllipticCurves.generateKeyPair(parameters.getCurveType().toParameterSpec());
    ECPublicKey pubKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privKey = (ECPrivateKey) keyPair.getPrivate();

    EcdsaPublicKey publicKey =
        EcdsaPublicKey.builder()
            .setParameters(parameters)
            .setIdRequirement(idRequirement)
            .setPublicPoint(pubKey.getW())
            .build();

    return EcdsaPrivateKey.builder()
        .setPublicKey(publicKey)
        .setPrivateValue(
            SecretBigInteger.fromBigInteger(privKey.getS(), InsecureSecretKeyAccess.get()))
        .build();
  }
This key manager generates new {@code EcdsaPrivateKey} keys and produces new instances of {@code
EcdsaSignJce}.
java_src/src/main/java/com/google/crypto/tink/signature/EcdsaSignKeyManager.java