final byte[] skey = WSTrustUtil.generateRandomSecret(keysizeInBytes);
cipher.init(XMLCipher.ENCRYPT_MODE, new SecretKeySpec(skey, "AES"));
// Encrypt the assertion and return the Encrypteddata
final Document owner = assertion.getOwnerDocument();
final EncryptedData encData = cipher.encryptData(owner, assertion);
final String id = "uuid-" + UUID.randomUUID().toString();
encData.setId(id);
final KeyInfo encKeyInfo = new KeyInfo(owner);
final EncryptedKey encKey = encryptKey(owner, skey, serCert, appliesTo, keyWrapAlgorithm);