title: Code signing with osslsigncode - Publisher Unknown
body: <p>I encountered a bit peculiar behavior when trying to automate compilation and signing of particular NSIS-based binary. Namely, <code>makensis</code> is run under <code>wine</code> to compile the executable, and afterwards the <code>osslsigncode</code> is used to sign the binary.  </p>
  
  <p>Executable seems to be built fine, as it works on Windows systems, however there's an issue (in the lack of better word) with the signing. As the code signing certificate is in PKCS#12 format, the command used is as suggested <a href="http://sourceforge.net/projects/osslsigncode/files/osslsigncode/" rel="nofollow">here</a>:  </p>
  
  <p><code>osslsigncode sign -pkcs12 &lt;pkcs12-file&gt; -pass &lt;pkcs12-password&gt; \
          -n "Your Application" -i http://www.yourwebsite.com/ \
          -in yourapp.exe -out yourapp-signed.exe</code></p>
  
  <p>I get "Succeeded" message from osslsigncode, as if the signing went OK, however when the binary is run on Windows (Win 7 in this case), UAC says:  </p>
  
  <p>Publisher: <strong>Unknown</strong></p>
  
  <p>The strange thing is that when I opened the extracted cert from original <code>.p12</code> file, to view it's info, Windows was afterwards able to recognize the publisher and the digital signature, as if it somehow became aware of the certification path...?</p>
  
  <p>Any advice would be appreciated.  </p>
  
  <p><strong>EDIT 1</strong><br>
  osslsigncode versions used: 1.5.2 and 1.7.1  </p>
  
  <p><strong>EDIT 2</strong><br>
  For the sake of comparison, I tried signing with <code>SignTool</code>, and apparently it works without any problem. So this looks like cert + <code>osslsigncode</code> issue, but I can't tell what is it exactly.  </p>
  
  <p>I also tried <code>osslsigncode</code> on the exact same EXE with another cert, and to make matters more interesting, it worked... (I noticed certification paths differ for the 2 certs).  </p>
  
  <p>Some cert details:  </p>
  
  <p>1) <em>non-working cert</em><br>
  version: V3<br>
  public key: RSA 2048 bits<br>
  signature hash algorithm: sha1<br>
  signature algorithm: sha1RSA<br>
  certification path: USERTrust -> Comodo Code Signing CA 2 -> NonWorkingCert</p>
  
  <p>2) <em>working cert</em><br>
  version: V3<br>
  public key: RSA 2048 bits<br>
  signature hash algorithm: sha1<br>
  signature algorithm: sha1RSA<br>
  certification path: USERTrust -> UTN-UserFirst-Object -> Comodo Code Signing CA 2 -> WorkingCert</p>