encryption.getContentEncryptionKey(),
encryption.getIv());
} catch (IOException ex) {
throw new SecurityException(ex);
}
OutputStream jweStream = new JweOutputStream(actualOs, encryption.getCipher(),
encryption.getAuthTagLen());
if (encryption.isCompressionSupported()) {
jweStream = new DeflaterOutputStream(jweStream);
}
ctx.setOutputStream(jweStream);
ctx.proceed();
jweStream.flush();
} else {
CachedOutputStream cos = new CachedOutputStream();
ctx.setOutputStream(cos);
ctx.proceed();
String jweContent = theEncryptionProvider.encrypt(cos.getBytes(), ctString);