private JsonObject toJson(Keyset.Key key) {
    JsonObject json = new JsonObject();
    json.add("keyData", toJson(key.getKeyData()));
    json.addProperty("status", key.getStatus().name());
    json.addProperty("keyId", toUnsignedLong(key.getKeyId()));
    json.addProperty("outputPrefixType", key.getOutputPrefixType().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