title: Error while decrypting HSM keys using nCipherKM
body: <p>I am trying to decrypt Database password stored in a Securestorage file. I am using the nCipherKM HSM security provider and the Key Encryption Keys used for decryption is stored in a key store (folder). While I try to load the HSM Key Store by passing the keystore password , it fails to load the key store with the following Exception. Not sure what is the root cause of this error. </p>
  
  <p>Code Snippet:  </p>
  
  <pre><code>java.security.provider hsm_provider = (java.security.provider)Class.forName("com.ncipher.provider.km.nCipherKM").newInstance();  
  java.security.Security.addProvider(hsm_provider);  
  myKeyStore = KeyStore.getInstance(KeyStore.getDefaulttype,"nCipherKM");  
  myKeyStore .load(new FileInputStream(KeyStorePath),pwdOfKeyStore);
  </code></pre>
  
  <p>Exception:  </p>
  
  <blockquote>
    <p>java.io.IOException: <strong>A password was supplied but all keys are
    module</strong> protected.   at
    com.ncipher.provider.km.KMKeyStore.engineLoad()</p>
  </blockquote>