The javax.xml.crypto package contains common classes that are used to perform XML cryptographic operations, such as generating an XML signature or encrypting XML data. Two notable classes in this package are the javax.xml.crypto.KeySelector class, the purpose of which is to allow developers to supply implementations which locate and optionally validate keys using the information contained in a KeyInfo object, and the javax.xml.crypto.URIDereferencer class which allows developers to create and specify their own URI dereferencing implementations.
The javax.xml.crypto.enc package includes interfaces that represent the core elements defined in the W3C XML encryption specification. Of primary significance is the javax.xml.crypto.enc.EncryptedType class, which allows you to encrypt and decrypt an XML. Most of the XML encryption structures or elements are represented by a corresponding interface (except for the javax.xml.crypto.enc.keyinfo.EncryptedKey and javax.xml.crypto.enc.keyinfo.AgreementMethod structures, which are included in their own package, and discussed in the next paragraph). These interfaces include: EncryptedData, CipherData, CipherReference, CipherValue, EncryptionMethod, DataReference, KeyReference, EncryptionProperties and EncryptionProperty. The XMLEncryptionFactory class is an abstract factory that is used to create objects that implement these interfaces.
The javax.xml.crypto.enc.keyinfo package contains interfaces that represent most of the KeyInfo related structures defined in the W3C XML encryption recommendation, including EncryptedKey and AgreementMethod. The XMLEncryptionFactory class is an abstract factory that is used to create objects that implement these interfaces.
The javax.xml.crypto.enc.spec package contains interfaces and classes representing input parameters for the encryption algorithms used in the processing of XML encryption.
Finally, the javax.xml.crypto.enc.dom package contains DOM-specific classes for the javax.xml.crypto.enc package. Only developers and users who are creating or using a DOM-based XMLEncryptionFactory implementation should need to make direct use of these packages.