moeXML <mmasiane <at> yahoo.com> writes:
> This is not a repost. I need help resolving the problem I am having with XML
> decryption. The document seems to be encrypting fine, but the decryption
> seems to fail, when I try to unwrap the symmetric key using a private key.
> Your help is appreciated. See code snippets below-
> ...
> ...
> Then, I try to decrypt:
> XMLCipher xmlCipher = XMLCipher.getInstance(); 
> 
>         xmlCipher.init(XMLCipher.DECRYPT_MODE, key);
>         xmlCipher.setKEK(kek);


I think you want to use your kek to decrypt the key, so you don't want to hard 
code the symmetric key in the call to init. Try calling:
xmlCipher.init(XMLCipher.DECRYPT_MODE, null);
See org.apache.xml.security.samples.encryption.Decrypter



Reply via email to