@SuppressWarnings("UnusedException")
  public static String serializeKeysetWithoutSecret(KeysetHandle keysetHandle)
      throws GeneralSecurityException {
    try {
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      keysetHandle.writeNoSecret(JsonKeysetWriter.withOutputStream(outputStream));
      return new String(outputStream.toByteArray(), UTF_8);
    } catch (IOException e) {
      throw new GeneralSecurityException("Serialize keyset failed");
    }
  }
Functions to parse and serialize Keyset in Tink's JSON format based on Protobufs.
java_src/src/main/java/com/google/crypto/tink/TinkJsonProtoKeysetFormat.java