I recently was working on a client project in WebSphere Commerce, specifically within the payment framework and needed to update some data within the PPCEXTDATA table. As I needed to encrypt the data specific to the WebSphere Commerce instance, I needed to discover the plain text merchant key to encrypt the data so it could be read and decrypted properly.
To retrieve the merchant key, I created the following JSP, that allows discovery and retrieval of both the encrypted and plain text merchant key. I then just copied this into my Stores project, and accessed the JSP from a browser.
<%@ page import="com.ibm.commerce.util.nc_crypt" %> <p>Encrypted Merchant Key: <%=com.ibm.commerce.server.WcsApp.configProperties.getValue("Instance/MerchantKey")%></p> <p>Decrypted (Plain Text) Merchant Key: <%=nc_crypt.decrypt(com.ibm.commerce.server.WcsApp.configProperties.getValue("Instance/MerchantKey"), null)%></p>