public static void serializeKeyset(
      KeysetHandle keysetHandle, KeysetWriter writer, SecretKeyAccess access) throws IOException {
    if (access == null) {
      throw new NullPointerException("SecretKeyAccess cannot be null");
    }
    CleartextKeysetHandle.write(keysetHandle, writer);
  }
Serialize a keyset to the writer.

<p>This method is used to serialize keysets that may contain secret key material. The last
argument must be {@code InsecureSecretKeyAccess.get()}.
java_src/src/main/java/com/google/crypto/tink/LegacyKeysetSerialization.java