This topic explains how to configure and apply the XML Encryption tool in SOAtest and Virtualize. This tool encrypts XML documents for security purposes.
Sections include:
In order to securely send data across the Internet during a Web service transaction, security standards must be put in place to ensure that outside parties cannot view or read any of the private transaction data. The XML Encryption standard recommended by the W3C defines a process that allows any data in XML documents to be encrypted and decrypted. It specifies the data to be encrypted, as well giving information about the cipher or key used to encrypt the data.
The XML Encryption tool supports the W3C XML Encryption standard and the WS-Security standard from OASIS. The XML Encryption Tool allows you to encrypt and decrypt data to be sent as Web service transactions. The XML Encryption tool also allows you to encrypt individual elements of the XML document, or the entire document itself. This feature is especially useful for Web service transactions that are performed between multiple partners or endpoints. For example, a credit card transaction can be encrypted where the user’s name and address are visible, but the user’s credit card number is encrypted.
The XML Encryption Tool allows you to either Encrypt or Decrypt data. Depending on the Encryption Mode you select, the options for Encrypt mode and Decrypt will vary.
Before using the XML Encryption Tool, you must download the Unlimited Strength Java Cryptograpy Extension. For more information, see Unlimited Strength Java Cryptography Extension. |
The following options display in the left pane of the Tool Settings tab:
When selecting General from the left pane of the Tools Settings tab, the following options are available:
WS-Security Mode: Enables OASIS WS-Security 1.0 for encrypting SOAP messages. Enable this option and the Encrypt SOAP Body (WS-Security Mode) or Entire Document (non WS-Security mode) option to automatically encrypt the content of the Body element. WS-Security Mode uses asymmetric encryption but does not allow use of key stores or explicit key values.
Asymmetric (non-WS-Security): Enables the use of a symmetric key to encrypt the data and an asymmetric key to encrypt the block encryption key. You may also choose to use a key store or an explicit key value.
Symmetric (non-WS-Security): Enables the use of only one secret, shared, symmetric key to encrypt the data directly.
Key Transport (Key Encryption): Specifies the unique algorithm used to encrypt the key.
Key Store: Specifies the key store for the key-encryption key. The Key Stores available in this menu are dependent on the Key Stores you added at the test or Responder suite level. For more information on adding Key Stores, see Global Key Stores.
Symmetric (Block Encryption): Specifies the unique algorithm used to encrypt the data.
Automatic Key: Enables automatic block encryption key generation.
Use Key Store: Specifies the key store used for the Symmetric (Block Encryption) key. The Key Stores available in this menu are dependent on the Key Stores you added at the test or Responder suite level.For more information on adding Key Stores, see Global Key Stores.
Explicit Key Value: Enter an explicit key, depending on the Algorithm you selected from the Symmetric (Block Encryption) menu.
When selecting Target Elements from the left pane of the Tools Settings tab, the following options are available—if Encrypt is selected in the General tab:
Target: Allows you to choose either Entire Element or Content Only.
Selecting Entire Element will encrypt the entire XPath.
Selecting Content Only will encrypt only the text content.
When selecting Emulation Options from the left pane of the Tools Settings tab, the following options are available:
The following options are available only if WS-Security Mode is selected in the General tab. |
With Encryption Options selected in the left pane of the Tools Settings tab, the following options are available:
With Decryption Options selected in the left pane of the Tools Settings tab, the following options are available:
The following options are available only if the Decrypt radio button is selected in the General tab. |
Key Store: Specifies the key store used to verify the signature. The Key Stores available in this menu depend on the Key Stores you added at the test or Responder suite level.For more information on adding Key Stores, see Global Key Stores.
The Input Type tab is only available if the XML Encryption tool is added as a standalone tool and not chained to another tool. The following options are available from the Input Type tab:
Check the Persist as Relative Path option if you want the path to this file to be saved as a path that is relative to the current configuration file. Enabling this option makes it easier to share tools across multiple machines. If this option is not enabled, the test or Responder suite will save the path to this file as an absolute path.
You can use the XML Encryption tool as a stand-alone tool at the test suite level by right-clicking the main test suite node and selecting Add New> Test from the shortcut menu and then selecting XML Encryption from the dialog that opens.
You can also chain the XML Encryption tool to a tool by right-clicking the desired tool node and selecting Add Output from the shortcut menu and then selecting XML Encryption from the dialog that opens. The tool will use the transformed XML.
You can chain the XML Encryption tool and the XML Signer tool to a messaging tool to perform both encryption and XML signature on a message. For more information on the XML Signer tool, see XML Signer.
You can also chain any tool, such as an Edit or Browse tool, to the XML Encryption Tool by right-clicking the desired XML Encryption Tool node and selecting Add Output from the shortcut menu and then selecting XML Encryption from the dialog that open
In order to perform security operations using the XML Signature Verifier, XML Signer, or XML Encryption tools, or if using Key Stores, you will need to download and install the Unlimited Strength Java Cryptography Extension. For details, see JCE Prerequisite. |
The following tutorial lesson demonstrates how to use this tool: