Key Locator Framework (KLF)

To comply with the Payment Card Industry Data Security Standard (PCI DSS), a Key Locator Framework (KLF) is introduced to allow an encryption key to be stored outside of WebSphere Commerce. For example, the merchant key can now be stored and retrieved from a configurable location such as from an external, more secure, device. This is accomplished by associating each encryption key with a key provider class.

There are two key providers that are ready for immediate use. Key providers for Merchant key:

Note: The KLF does not support defining a custom session key implementation. This option is only available for merchant keys.

To store the encryption key by using a different mechanism, for example, by using a hardware device, we must create a custom key provider class. This class must implement the WCKey interface, and extend from the following abstract class: WCKeyBaseImpl. This abstract class implements some of the common methods on the WCKey interface. The list of encryption keys available to the system is registered in a key configuration file.

To define an alternative merchant key provider in a separate custom key configuration file, see
Implementation of the KLF. The default key configuration file is WCKeys.xml, which contains the following:

Where:

Once all the encryption keys are registered in the key configuration file, the WCKeyRegistry class is used for reading this file and caches all the key providers in memory.

We can use the getKey(strKeyName) and getNewKey(strKeyName) methods of WCKeyRegistry to retrieve the current and new key provider. For example, to retrieve the "current" key with a particular name, we can use the following code snippet:

To retrieve the "new" key with a particular name and provider:

The main WCKeyRegistry methods are as follows:


Related concepts
Implementation of the KLF


Related tasks
Encrypting data in custom code using EncryptionFactory