theHeaders.setContentType(contentType);
}
byte[] theCek = getContentEncryptionKey();
String contentEncryptionAlgoJavaName = Algorithm.toJavaName(theHeaders.getContentEncryptionAlgorithm());
KeyProperties keyProps = new KeyProperties(contentEncryptionAlgoJavaName);
keyProps.setCompressionSupported(compressionRequired(theHeaders));
byte[] additionalEncryptionParam = theHeaders.toCipherAdditionalAuthData(writer);
keyProps.setAdditionalData(additionalEncryptionParam);
byte[] theIv = getContentEncryptionCipherInitVector();
AlgorithmParameterSpec specParams = getContentEncryptionCipherSpec(theIv);
keyProps.setAlgoSpec(specParams);
byte[] jweContentEncryptionKey = getEncryptedContentEncryptionKey(theCek);
JweEncryptionInternal state = new JweEncryptionInternal();
state.theHeaders = theHeaders;
state.jweContentEncryptionKey = jweContentEncryptionKey;
state.keyProps = keyProps;