title: cryptoapi and openssl
body: <p>I'm trying to encrypt and sign a file with cryptoapi with some X.509 certificates. I want to verify and decrypt this file with openssl.</p>
  
  <p>On windows I think I need to use the <code>CryptSignAndEncryptMessage</code> function to encrypt and sign data. I used <a href="http://msdn.microsoft.com/en-us/library/aa382367%28v=vs.85%29.aspx" rel="nofollow">this example from MSDN</a> to create a signed and encrypted message.</p>
  
  <p>How can I decrypt/verify this file using openssl? I removed the first 4 bytes from the message since it contained the length of the message (from the windows blob).
  When I call <code>openssl -asn1parse</code> I get <a href="http://pastebin.com/wiF507bM" rel="nofollow">some output</a> that indicates it to be parsable by openssl.</p>
  
  <p>When trying to verify the signature with openssl I recieve an error:</p>
  
  <pre><code>openssl rsautl -verify -inkey AlonsoCert.pem -keyform pem -certin -in sandvout-without-4byte.txt
  RSA operation error
  3073579208:error:0406706C:rsa routines:RSA_EAY_PUBLIC_DECRYPT:data greater than mod len:rsa_eay.c:680:
  </code></pre>