Thursday, June 16, 2011

Retrieving Merchant Key From Websphere Commerce

While installing the websphere commerce server you normally provide the merchant key and that key will be used for enrypting and decrypting different values in the system. When we want to directly encrypt the value using the wcs utilities we have to provide the merchant key and if we forget the merchant key we can directly get it from the server using the following methods
  • Call the method com.ibm.commerce.server.ConfigProperties.singleton().getMerchantKey()
  • or Call the method com.ibm.commerce.server.WcsApp.configProperties.getMerchantKey()
The above methods are there in WCS6. WCS7 on wards you have to use the following

com.ibm.commerce.util.nc_crypt.decrypt(ConfigProperties.singleton().getValue("Instance/MerchantKey")

No comments:

Post a Comment