You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (Commented) (JIRA)" <ji...@apache.org> on 2012/03/22 10:50:22 UTC
[jira] [Commented] (SANTUARIO-305) No way to register internal key
resolvers in DECRYPT_MODE
[ https://issues.apache.org/jira/browse/SANTUARIO-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235484#comment-13235484 ]
Colm O hEigeartaigh commented on SANTUARIO-305:
-----------------------------------------------
Hi Clement,
Could you submit a patch for whatever solution you think is best and I'll review it? It seems like a reasonable thing to be able to do - so long as the solution doesn't break backwards compatibility.
Colm.
> No way to register internal key resolvers in DECRYPT_MODE
> ---------------------------------------------------------
>
> Key: SANTUARIO-305
> URL: https://issues.apache.org/jira/browse/SANTUARIO-305
> Project: Santuario
> Issue Type: Improvement
> Affects Versions: Java 1.5.1
> Reporter: Clement Pellerin
> Assignee: Colm O hEigeartaigh
>
> 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().
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira