@SuppressWarnings("UnusedException")
  public static KeysetHandle parseEncryptedKeyset(
      String serializedEncryptedKeyset, Aead keysetEncryptionAead, byte[] associatedData)
      throws GeneralSecurityException {
    try {
      return KeysetHandle.readWithAssociatedData(
          JsonKeysetReader.withString(serializedEncryptedKeyset),
          keysetEncryptionAead,
          associatedData);
    } catch (IOException e) {
      throw new GeneralSecurityException("Parse 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