santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang Freis <>
Subject Problem decrypting elements
Date Fri, 26 Oct 2007 20:29:47 GMT

I'm new to working with XML encryption and have come across a problem.
Neither the email archive nor have brought ne closer to a solution.

Google Starting with the sample files and I
have managed to en- and decrypt elements by name.  However, decryption
works only when there is only one element encrypted.  If I encrypt
multiple elements by name--as siblings or as children of different
parents--the decryptor throws an exception:

Oct 26, 2007 3:56:45 PM
SEVERE: XMLCipher::decryptElement called without a key and unable to
Exception in thread "main"
    No Key Encryption Key loaded and cannot determine using key resolvers

My IDE tells that the key file was loaded and, as I said, the decryption
works fine when only one element of the XML is encrypted.  I tried
decrypting by iterating over the NodeList returned from
getElementsByTagNameNS(namespaceURI, localName) and trying to just grab
the first item.  Both generate the same exception.  From what I can see in
the IDE is that the method decryptToByteArray(Element element) called from
doFinal( document, encryptedDataElement) throws the exception, but it
escapes me why that happens.

Any help will be greatly appreciated.


View raw message