@AccessesPartialKey
  private static JwtEcdsaPrivateKey createKey(
      JwtEcdsaParameters parameters, @Nullable Integer idRequirement)
      throws GeneralSecurityException {
    KeyPair keyPair =
        EllipticCurves.generateKeyPair(parameters.getAlgorithm().getECParameterSpec());
    ECPublicKey pubKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privKey = (ECPrivateKey) keyPair.getPrivate();

    JwtEcdsaPublicKey.Builder publicKeyBuilder =
        JwtEcdsaPublicKey.builder().setParameters(parameters).setPublicPoint(pubKey.getW());
    if (idRequirement != null) {
      publicKeyBuilder.setIdRequirement(idRequirement);
    }
    return JwtEcdsaPrivateKey.create(
        publicKeyBuilder.build(),
        SecretBigInteger.fromBigInteger(privKey.getS(), InsecureSecretKeyAccess.get()));
  }
This key manager generates new {@code JwtEcdsaSignKey} keys and produces new instances of {@code
JwtPublicKeySign}.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtEcdsaSignKeyManager.java