private EncryptedKeyset encryptedKeysetFromJson(JsonObject json) throws IOException {
    validateEncryptedKeyset(json);
    byte[] encryptedKeyset;
    if (urlSafeBase64) {
      encryptedKeyset = Base64.urlSafeDecode(json.get("encryptedKeyset").getAsString());
    } else {
      encryptedKeyset = Base64.decode(json.get("encryptedKeyset").getAsString());
    }
    if (json.has("keysetInfo")) {
      return EncryptedKeyset.newBuilder()
          .setEncryptedKeyset(ByteString.copyFrom(encryptedKeyset))
          .setKeysetInfo(keysetInfoFromJson(json.getAsJsonObject("keysetInfo")))
          .build();
    } else {
      return EncryptedKeyset.newBuilder()
          .setEncryptedKeyset(ByteString.copyFrom(encryptedKeyset))
          .build();
    }
  }
Static method to create a JsonKeysetReader from a {@link Path}.

<p>Note: the file path won't be read until {@link JsonKeysetReader#read} or {@link
JsonKeysetReader#readEncrypted} is called.

<p>This method only works on Android API level 26 or newer.

@deprecated Method should be inlined.
java_src/src/main/java/com/google/crypto/tink/JsonKeysetReader.java