Sun provides a Java API to the XML-Enc specificati

2019-07-17 20:12发布

问题:

I`m searching if there is how to execute the XML-Enc specification http://en.wikipedia.org/wiki/XML_Encryption without use of external APIs like Apache Santuario.

Thanks in advance!

回答1:

Nope, there is no internal XML encryption library, because the JSR-106 has been withdrawn. So you have to use a external API. Unfortunately the Santuario API is not as clean as most API's that are included in the Java runtime.

http://www.jcp.org/en/jsr/detail?id=106

PS when using any XML encryption library, be sure to verify the content before decrypting, or you will have problems with e.g. padding oracle attacks (this warning is in the W3C XML encryption specification, but it is ignored all to often).