Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java 1.5.1
-
None
-
Security Level: Public (Public issues, viewable by everyone)
-
None
Description
There is no way to register internal key resolvers in DECRYPT_MODE. The internal resolvers are usually registered on a KeyInfo. When we call XMLCipher.doFinal(Document, Element) to decrypt, it creates a new EncryptedData object on the fly and uses it immediately (See XMLCipher.decryptToByteArray). There is no chance to modify the KeyInfo inside that EncryptedData before it is used. It is possible to call XMLCipher.loadEncryptedData() separately, but there is little we can do with that EncryptedData afterwards. Using the static resolvers is not thread-safe in general. By that I mean, you cannot configure the static resolver per thread unless you use thread local storage.
Possible solutions:
1. Let the XMLCipher maintain a list of internal key resolvers directly.
2. Pass internal resolvers when calling doFinal()
3. Add a method XMLCipher.decryptData(EncryptedData) similar to decryptKey(EncryptedKey),
So we could call XMLCipher.loadEncryptedData(Element), modify the KeyInfo inside the EncryptedData, and call XMLCipher.decryptData().
Attachments
Attachments
Issue Links
- supercedes
-
SANTUARIO-227 impossible to subclass XMLCipher
- Closed