Assert.notNull(outputStream, "outputStream");
try {
SecretKey key = crypter.getSecretKey();
XmlDocument document = new XmlDocument(CrypterIOHelper.SYNC_CRYPTER_ELEMENT);
XmlElement root = document.getRoot();
root.addElement(CrypterIOHelper.KEY_ALGORITHM_ELEMENT).setData(crypter.getAlgorithm());
CrypterIOHelper.addKey(root, CrypterIOHelper.SECRET_KEY_ELEMENT, key);
document.write(outputStream);
} catch (IOException e) {
throw new CrypterException(e);
}