I have spent quite a bit of time on Google searching for the answer to this. I have found several pieces of code describing solutions but most are in C, .NET, or Java. My case is VB6.
I have a pretty straightforward RSA1 application: sign some data (in "appA" with private key), then validate signature (in "appB" with public key, this is the VB6 app). Right now everything is running fine via the CryptoAPI library.
The "appA" signature portion needs to be moved to a unix server and carried out by OpenSSL (preferably). The problem is converting the key format from PEM to the PublicKeyBlob that CryptoAPI expects.
I have tried to port this C code to VB. CryptStringToBinary succeeds but CryptDecodeObjectEx just hangs then crashes VB.
I haven't been able to find any documentation showing this use in VB. I'm not sure that it's possible even. I'm hoping someone may be able to shed some light on this. I have also tried the CryptDecodeObject (sans "Ex") function hoping that the lack of all the structures needed would solve the issue... but same problem.
My test key was generated by OpenSSL using openssl_pkey_new