throw new EncryptionException("Error initializing cipher instance on key encryption", e);
}
org.apache.xml.security.encryption.EncryptedKey apacheEncryptedKey;
try {
apacheEncryptedKey = xmlCipher.encryptKey(containingDocument, targetKey);
postProcessApacheEncryptedKey(apacheEncryptedKey, targetKey, encryptionKey,
encryptionAlgorithmURI, containingDocument);
} catch (XMLEncryptionException e) {
log.error("Error encrypting element on key encryption", e);
throw new EncryptionException("Error encrypting element on key encryption", e);