XML Encryption (Keystore)
This adapter encrypts or decrypts any XML document according to the W3C standard XML-Encryption (XML-Enc) based on a PKCS12 or JCEKS keystore. This adapter supports the AES encryption algorithm with 128, 192 or 256 Bit key length as well as the Triple-DES algorithm. For encryption/decryption based on a password, see XML Encryption (Password).
Properties
Operation | Defines the operation executed by the function adapter Possible values:
|
Adapter | Main adapter class (do not change!) Possible values: de.softproject.integration.adapter.xml.encryption.XmlEncryption: Main class (Default) |
method | Algorithm used for encryption/decryption Possible values:
|
xpath | Path to the element(s) to be encrypted/decrypted addressed using an XPath expression Possible values: |
scope | Defines the encryption scope within the XML document structure that matches the XPath expression
|
keyStoreURL | URL to a valid keystore document Possible values: |
keyStoreType | Keystore type to be used Possible values:
|
password | Password to access the keystore Possible values: |
alias | Alias for the key inside the keystore Possible values: |
aliasPassword | Password to retrieve the key via its alias specified above (optional) Possible values:
|
Status values
-1 (error) | An error occurred during the adapter's execution (see X4 Server log). In case of an error, this adapters also outputs a text file that contains the corresponding exception. |
0 (empty) | Document has not been changed. No matching elements were found. |
1 (successful) | Document has been processed, and all matching elements have been encrypted/decrypted. |
Example
In the following XML document, all Data
elements are to be encrypted using XML-Encryption with the AES128 algorithm:
Input
<RootElement>
<Data>Hello</Data>
<Data>World!</Data>
<Public>© SoftProject GmbH</Public>
</RootElement>
As an example, the adapter returns the following encrypted result XML document:
Result
<RootElement>
<Data>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
Type="http://www.w3.org/2001/04/xmlenc#Content">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" />
<xenc:CipherData>
<xenc:CipherValue>JS1lBp4RcMk6RepmptplJnBGqbpINGHSV9THG7+UJcY
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</Data>
<Data>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
Type="http://www.w3.org/2001/04/xmlenc#Content">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" />
<xenc:CipherData>
<xenc:CipherValue>rO+m1iPwsw4/PaP2AokM30DqsqeD1OYRvD7KNG+bnxc
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</Data>
<Public>© SoftProject GmbH</Public>
</RootElement>