@AccessesPartialKey
  private static JwtRsaSsaPkcs1PublicKey convertToRsaSsaPkcs1Key(JsonObject jsonKey)
      throws GeneralSecurityException {
    JwtRsaSsaPkcs1Parameters.Algorithm algorithm;
    switch (getStringItem(jsonKey, "alg")) {
      case "RS256":
        algorithm = JwtRsaSsaPkcs1Parameters.Algorithm.RS256;
        break;
      case "RS384":
        algorithm = JwtRsaSsaPkcs1Parameters.Algorithm.RS384;
        break;
      case "RS512":
        algorithm = JwtRsaSsaPkcs1Parameters.Algorithm.RS512;
        break;
      default:
        throw new GeneralSecurityException(
            "Unknown Rsa Algorithm: " + getStringItem(jsonKey, "alg"));
    }
    if (jsonKey.has("p")
        || jsonKey.has("q")
        || jsonKey.has("dp")
        || jsonKey.has("dq")
        || jsonKey.has("d")
        || jsonKey.has("qi")) {
      throw new UnsupportedOperationException("importing RSA private keys is not implemented");
    }
    expectStringItem(jsonKey, "kty", "RSA");
    validateUseIsSig(jsonKey);
    validateKeyOpsIsVerify(jsonKey);

    BigInteger publicExponent =
        new BigInteger(1, Base64.urlSafeDecode(getStringItem(jsonKey, "e")));
    BigInteger modulus = new BigInteger(1, Base64.urlSafeDecode(getStringItem(jsonKey, "n")));

    if (jsonKey.has("kid")) {
      return JwtRsaSsaPkcs1PublicKey.builder()
          .setParameters(
              JwtRsaSsaPkcs1Parameters.builder()
                  .setModulusSizeBits(modulus.bitLength())
                  .setPublicExponent(publicExponent)
                  .setAlgorithm(algorithm)
                  .setKidStrategy(JwtRsaSsaPkcs1Parameters.KidStrategy.CUSTOM)
                  .build())
          .setModulus(modulus)
          .setCustomKid(getStringItem(jsonKey, "kid"))
          .build();
    } else {
      return JwtRsaSsaPkcs1PublicKey.builder()
          .setParameters(
              JwtRsaSsaPkcs1Parameters.builder()
                  .setModulusSizeBits(modulus.bitLength())
                  .setPublicExponent(publicExponent)
                  .setAlgorithm(algorithm)
                  .setKidStrategy(JwtRsaSsaPkcs1Parameters.KidStrategy.IGNORED)
                  .build())
          .setModulus(modulus)
          .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