Take the 2-minute tour ×  I'm trying to develop a license
verification solution.  Licences are encoded on server using
RSA_private_encrypt openssl function.  For Mac OX X I use
openssl RSA_public_decrypt and it works like a charm. On Windows
I must use very tiny bit of code, so I can not link with openssl
or other lib AND I have to use Crypto API.  I have spent several
days trying to figure out what is wrong, but with no luck. I can
successfully import public key, but here my success ends. I'm
aware that I need to reverse byte order with CAPI so this might
not be the issue.  I have tried everything, including
CryptVerifyMessageSignatureWithKey and CryptDecodeObject to load
the blob with different params, but still no luck.  It always
ends up with GetLastError() == CRYPT_E_ASN1_BADTAG, which I
assume means that the BLOB is not ASN1 formatted... Google does
not tell anything on the output format of RSA_private_encrypt...
so I am completely lost here.  Here is the OS X code based on
OpenSSL:      void cr_license