title: Unable to access key in HSM for sh256 signing but can for sha1 signing
body: <p>How can I enable access to key in HSM when signing as sha256?</p>
  
  <p>When I sign as sha1 sign tool properly pulls the cert key out of the HSM but if I change to "/fd sha256" the key can't be found within the container.  I'm sure signtool can access the container, but some policy must be blocking this in the sha256 case. </p>
  
  <p>My Error:</p>
  
  <p>SignTool Error: The specified private key container was not found.</p>
  
  <p>Sha256 command:</p>
  
  <pre><code>signtool.exe sign /f mycert.crt
  /csp "Luna Cryptographic Services for Microsoft Windows" 
  /kc mycontainer /tr http://timestamp.digicert.com /td sha256 
  /fd sha256 signed-file.exe
  </code></pre>
  
  <p>Sha256 command, which works:</p>
  
  <pre><code>signtool.exe sign /f mycert.crt
  /csp "Luna Cryptographic Services for Microsoft Windows" 
  /kc mycontainer /tr http://timestamp.digicert.com /td sha256 
  /fd sha1 signed-file.exe
  </code></pre>
  
  <p><strong>/debug</strong> and <strong>/v</strong> options offer no additional information.  </p>
  
  <p>If I use makecert to generate a new self signed cert it the command generates a container which CSP can use for sha1 or sha256.  Luna's CSP\keymap.exe tool allows me to manage containers and keys.  I can create new ones for signing or exchange and then associate keys with them. </p>
  
  <p>Generate Cert and upload kes to HSM</p>
  
  <pre><code># Create Cert and store keys on HSM in a container called "noi1-501706key"
  makecert -sk noi1-501706key -sp "Luna Cryptographic Services for Microsoft Windows" -r 
  -n "CN=noi1- 501706" -ss TestStore noi1-501706.cer
  
  # make self signed
  Cert2Spc noi1-501706.cer noi1-501706.spc
  </code></pre>
  
  <p>Use Program Files\Safenet\Luna Client\CSP\keymap</p>
  
  <ul>
  <li>create new container</li>
  <li><p>associate pub/private with new container</p>
  
  <p>using new container sha1 works and sha256 fails.  All attempts to view the two containers show them as identical.</p></li>
  </ul>