Java XML Encryption and signatures

Java™ XML Encryption provides a standard set of APIs for XML digital encryption services and digital signature services.

You can use XML Digital Signature to perform detached, enveloped, and enveloping signatures as well as to sign arbitrary binary data and include this within an XML document. The result of encrypting data is an XML Signature element which contains or references the signature data.

You can use XML Encryption to perform fine-grained, element-based encryption of fragments within an XML Document as well as encrypt arbitrary binary data and include this within an XML document. The result of encrypting data is an XML Encryption element which contains or references the cipher data.