Class XmlEncryptionFactory
- java.lang.Object
-
- com.adaptris.security.SecurityServiceFactory
-
- com.adaptris.xml.security.XmlEncFactory
-
- com.adaptris.xml.security.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
EncryptedDatathat are generated, will have an attributeType="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 theRawXmlEncryptionFactoryin 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
-
-
Field Summary
-
Fields inherited from class com.adaptris.security.SecurityServiceFactory
log
-
-
Constructor Summary
Constructors Constructor Description XmlEncryptionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecurityServicebuild()KeyValuePairSetgetNamespaceContext()java.lang.StringgetXpath()voidsetNamespaceContext(KeyValuePairSet kvps)Set the namespace context for resolving namespaces.voidsetXpath(java.lang.String xpath)Set the XPATH that will be used to extract the Elements that will be encrypted.-
Methods inherited from class com.adaptris.xml.security.XmlEncFactory
createService, getIdGenerator, isEnabled, setIdGenerator
-
Methods inherited from class com.adaptris.security.SecurityServiceFactory
defaultInstance
-
-
-
-
Method Detail
-
build
protected SecurityService build() throws AdaptrisSecurityException
- Specified by:
buildin classXmlEncFactory- Throws:
AdaptrisSecurityException- See Also:
SecurityServiceFactory.createService()
-
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
EncryptedDataelements will be iteratively decrypted.- Parameters:
xpath- the xpath to set
-
getNamespaceContext
public KeyValuePairSet getNamespaceContext()
- Returns:
- the namespaceContext
-
setNamespaceContext
public void setNamespaceContext(KeyValuePairSet kvps)
Set the namespace context for resolving namespaces.- The key is the namespace prefix
- The value is the namespace uri
- Parameters:
kvps- the namespace context- See Also:
SimpleNamespaceContext.create(KeyValuePairSet)
-
-