@Override
public OutputStream getOutputStream() throws IOException {
final CipherOutputStream cipherOut = new CipherOutputStream(super.getOutputStream(), this.encrypt);
try {
return new HmacOutputStream(cipherOut, this.keyExchange.getSharedKey(AES_ALGORITHM_NAME));
} catch (Exception e) {
logger.error("Could not create hmac output stream.", e); //$NON-NLS-1$
throw new IOException(e);
}
}