public void writeWithAssociatedData(
      KeysetWriter keysetWriter, Aead masterKey, byte[] associatedData)
      throws GeneralSecurityException, IOException {
    EncryptedKeyset encryptedKeyset = encrypt(keyset, masterKey, associatedData);
    keysetWriter.write(encryptedKeyset);
  }
Serializes, encrypts with {@code masterKey} and writes the keyset to {@code outputStream} using
the provided associated data.
java_src/src/main/java/com/google/crypto/tink/KeysetHandle.java