title: Cannot generate Apple Passbook signature
body: <p>I am writing a shell script to automatically generate an Apple Passbook signature file from manifest.json using p12 certificate. Here is what I do:</p>
  
  <pre><code>openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -clcerts -nokeys -out certificate.pem
  openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -nocerts -out key.pem
  openssl smime  -passin pass:"mypass" -binary -sign -signer certificate.pem -inkey key.pem -in manifest.json -out signature -outform DER
  </code></pre>
  
  <p>The first two functions work fine. At least both certificate.pem and key.pem are created. The signature file is also created, but for some reason it is empty (0 bytes), although manifest.json is not empty, as well as certificate and key. How can this happen, and how can I fix it?</p>