@AccessesPartialKey
  private static JwtEcdsaPublicKey convertToEcdsaKey(JsonObject jsonKey)
      throws GeneralSecurityException {
    JwtEcdsaParameters.Algorithm algorithm;
    switch (getStringItem(jsonKey, "alg")) {
      case "ES256":
        expectStringItem(jsonKey, "crv", "P-256");
        algorithm = JwtEcdsaParameters.Algorithm.ES256;
        break;
      case "ES384":
        expectStringItem(jsonKey, "crv", "P-384");
        algorithm = JwtEcdsaParameters.Algorithm.ES384;
        break;
      case "ES512":
        expectStringItem(jsonKey, "crv", "P-521");
        algorithm = JwtEcdsaParameters.Algorithm.ES512;
        break;
      default:
        throw new GeneralSecurityException(
            "Unknown Ecdsa Algorithm: " + getStringItem(jsonKey, "alg"));
    }
    if (jsonKey.has("d")) {
      throw new UnsupportedOperationException("importing ECDSA private keys is not implemented");
    }
    expectStringItem(jsonKey, "kty", "EC");
    validateUseIsSig(jsonKey);
    validateKeyOpsIsVerify(jsonKey);

    BigInteger x = new BigInteger(1, Base64.urlSafeDecode(getStringItem(jsonKey, "x")));
    BigInteger y = new BigInteger(1, Base64.urlSafeDecode(getStringItem(jsonKey, "y")));
    ECPoint publicPoint = new ECPoint(x, y);

    if (jsonKey.has("kid")) {
      return JwtEcdsaPublicKey.builder()
          .setParameters(
              JwtEcdsaParameters.builder()
                  .setKidStrategy(JwtEcdsaParameters.KidStrategy.CUSTOM)
                  .setAlgorithm(algorithm)
                  .build())
          .setPublicPoint(publicPoint)
          .setCustomKid(getStringItem(jsonKey, "kid"))
          .build();
    } else {
      return JwtEcdsaPublicKey.builder()
          .setParameters(
              JwtEcdsaParameters.builder()
                  .setKidStrategy(JwtEcdsaParameters.KidStrategy.IGNORED)
                  .setAlgorithm(algorithm)
                  .build())
          .setPublicPoint(publicPoint)
          .build();
    }
  }
Converts a Json Web Key (JWK) set with public keys into a Tink KeysetHandle.

<p>It requires that all keys in the set have the "alg" field set. The currently supported
algorithms are ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384 and PS512. JWK is defined
in https://www.rfc-editor.org/rfc/rfc7517.txt.
java_src/src/main/java/com/google/crypto/tink/jwt/JwkSetConverter.java