Initialize KLF in WebSphere Commerce

If you want to retrieve the merchant key from a medium other than the WebSphere Commerce configuration file, define the encryption key providers in a separate custom key configuration file called, for example, CustomKeys.xml. Once you have defined this file, to make the external merchant key available to the WebSphere Commerce runtime, you must add the KeysConfigFile attribute, specified in the <Instance> section of the WebSphere Commerce configuration file. By defining this attribute, the Key Locator Framework (KLF) will retrieve the merchant key using the encryption key provider specified in the CustomKeys.xml instead of retrieving it from the WebSphere Commerce configuration file.

The value of the KeysConfigFile attribute is the location of the CustomKeys.xml relative to a path specified in the classpath of the WebSphere Commerce application. When WebSphere Commerce runtime reads this attribute from the WebSphere Commerce configuration file, it will load the custom keys configuration file as a resource from the classpath.

For example, if you deploy the CustomKeys.xml file in the WC_eardir/xml/config directory, since WC_eardir/xml directory is on the default classpath of WebSphere Commerce application, you will specify the following attribute in the WebSphere Commerce configuration file:

KeysConfigFile = "config/CustomKeys.xml"


If the KeysConfigFile attribute is not present in the WebSphere Commerce configuration file, the WebSphere Commerce runtime environment will load the configuration file from the following hard-coded location:

WC_eardir/xml/config/WCKeys.xml 


The CustomKeys.xml file itself should be deployed following the instructions in Deploying J2EE assets for a partial application.

The default WCKeys.xml applies to all instances. This default WCKeys.xml file will contain a WCMerchantKeyImpl provider, which will continue to read the merchant key from the file.

However, if the customer wants to store the merchant key in another location, such as in an external file or hardware device, they must add the KeysConfigFile attribute to the WebSphere Commerce configuration file, which specifies the location of their customized WCKeys.xml file relative to the classpath of the WebSphere Commerce application. This customized WCKeys.xml file will register the new encryption key provider class, which manages the merchant key stored in the new location.

 

Related Concepts


Key Locator Framework (KLF)