com.ibm.commerce.util

Class WCPasswordEncrypter

  • java.lang.Object
    • com.ibm.commerce.util.WCPasswordEncrypter


  • public class WCPasswordEncrypter
    extends java.lang.Object
    This class generates and returns user passwords encrypted in WebSphere Commerce format.
    • Constructor Summary

      Constructors 
      Constructor and Description
      WCPasswordEncrypter()
      Default Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String encryptPassword(java.lang.String password, java.lang.String salt)
      Returns the WC encrypted password with the given clear text password and salt.
      void initializeKeyRegistry(java.lang.String customKeyConfigFilename, java.lang.String instanceXMLFilename)
      Initializes the key registry by providing one of two parameters.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WCPasswordEncrypter

        public WCPasswordEncrypter()
        Default Constructor
    • Method Detail

      • initializeKeyRegistry

        public void initializeKeyRegistry(java.lang.String customKeyConfigFilename,
                                          java.lang.String instanceXMLFilename)
                                   throws java.lang.Exception
        Initializes the key registry by providing one of two parameters. 1) Specify customKeyConfigFilename with the full path to the custom key configuration file if the merchant key is stored in an external medium. 2) Specify instanceXMLFilename with the full path to the instance configuration xml file if the merchant key is stored inside the instance configuration file. If both parameters are specified, it will first try to initialize the key registry with the custom key configuration file. If that fail, it will then try to initialize the key registry with the instance configuration file.
        Parameters:
        customKeyConfigFilename - The full path to the custom key configuration file
        instanceXMLFilename - The full path to the instance configuration xml file
        Throws:
        java.lang.Exception - Thrown if there is any error during key registry initialization.
      • encryptPassword

        public java.lang.String encryptPassword(java.lang.String password,
                                                java.lang.String salt)
                                         throws ECApplicationException
        Returns the WC encrypted password with the given clear text password and salt. The caller of this method must first initialize the key registry by calling the initializeKeyRegistry(String instanceXMLFilename, String customKeyConfigFilename) method.
        Parameters:
        password - The clear text password.
        salt - The salt.
        Returns:
        The corresponding WC encrypted password.
        Throws:
        ECApplicationException - when the key registry is not initialized.