/** Serializes, encrypts with {@code masterKey} and writes the keyset to {@code outputStream}. */ public void write(KeysetWriter keysetWriter, Aead masterKey) throws GeneralSecurityException, IOException { EncryptedKeyset encryptedKeyset = encrypt(keyset, masterKey); keysetWriter.write(encryptedKeyset); return; }
/** * Serializes and writes the {@link Keyset} managed by {@code handle} to {@code keysetWriter}. * * @throws IOException */ public static void write(KeysetHandle handle, KeysetWriter keysetWriter) throws IOException { keysetWriter.write(handle.getKeyset()); } }