Class XmlEncryptionFactory

  • All Implemented Interfaces:
    LicensedComponent

    public class XmlEncryptionFactory
    extends XmlEncFactory
    Implementation of SecurityServiceFactory for handling XML Encryption.

    If using this factory, then the document to be encrypted is expected to already be an XML document. This means that any EncryptedData that are generated, will have an attribute Type="http://www.w3.org/2001/04/xmlenc#Element". This may of course break some JSR106 implementations. If testing reveals that to be the case then you should use the RawXmlEncryptionFactory in preference which allows you to set the Type and MimeType respectively.

    THis is a pure XML Encryption implementation, any attempt to do signing will cause a UnsupportedOperationException to be thrown.

    The underlying encryption facility only allows for the following types of (the key length is implicit in the algorithm type and does not need to be specified) :

    • TRIPLEDES_CBC
    • AES256_CBC
    • AES192_CBC
    • AES192_CBC
    See Also:
    RawXmlEncryptionFactory

    In the adapter configuration file this class is aliased as xml-encryption-factory. which is the preferred alternative to the fully qualified classname when building your configuration.

    License Required: STANDARD

    • Constructor Detail

      • XmlEncryptionFactory

        public XmlEncryptionFactory()
    • Method Detail

      • getXpath

        public java.lang.String getXpath()
        Returns:
        the xpath
      • setXpath

        public void setXpath​(java.lang.String xpath)
        Set the XPATH that will be used to extract the Elements that will be encrypted.

        If the specifed XPath does not resolve to a NodeList of Elements, then an exception will be thrown by the underyling encryption implementation.

        Setting this has no effect when attempting decryption, all EncryptedData elements will be iteratively decrypted.

        Parameters:
        xpath - the xpath to set
      • getNamespaceContext

        public KeyValuePairSet getNamespaceContext()
        Returns:
        the namespaceContext