title: PHP openssl_pkcs7_verify Not Working
body: <p>I`m using pkcs7 to sign a document and everything works fine, the problem is that the command to verify the sign is not working, always return false. I try to use the terminal command into the file and works fine.</p>
  
  <p><b>Sign command:</b></p>
  
  <pre><code>openssl_pkcs7_sign(
      $tempdoc,
      $tempsign,
      $this-&gt;signature_data['signcert'],
      array($this-&gt;signature_data['privkey'],
      $this-&gt;signature_data['password']),
      array(),
      PKCS7_BINARY | PKCS7_DETACHED);
  </code></pre>
  
  <p><b>Verify command:</b></p>
  
  <pre><code>openssl_pkcs7_verify($tempsign, PKCS7_NOVERIFY)
  </code></pre>
  
  <p><b>Terminal command:</b></p>
  
  <pre><code>openssl pkcs7 -inform DER -in signature.pkcs7 -print_certs -text
  </code></pre>
  
  <p><br/></p>
  
  <p><b>EDIT 1</b>
  <br/>
  I make tests in my code and discover if i create my sign with only PKCS7_DETACHED or PKCS7_BINARY works fine the <b>verify</b>, but both together i receive the error. Why this is happening?</p>