private JsonObject toJson(KeyData keyData) {
    JsonObject json = new JsonObject();
    json.addProperty("typeUrl", keyData.getTypeUrl());
    json.addProperty("value", Base64.encode(keyData.getValue().toByteArray()));
    json.addProperty("keyMaterialType", keyData.getKeyMaterialType().name());
    return json;
  }
Static method to create a JsonKeysetWriter that writes to a file path.

<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/JsonKeysetWriter.java