Public Key Question
Is there a difference between a public key from a self-signed public/private key pair, and a public key extracted from a Certificate. The reason I ask is that when I extract the public key from an online certificate, and use it to create a Pre-Master and related keys, it works like a charm. But when I use a public key that I created using the Microsoft Crypto API, it returns an 0x80090003 Bad Key error. Both are 2048 bit/256 byte keys, and the error is returned on the CryptoImportKey function using the MS_DEF_RSA_SCHANNEL_PROV CSP.
It turns out that I created the keys using AT_SIGNATURE instead of AT_KEYEXCHANGE. Having fixed that problem, I have run into a different issue. After Acquiring a handle to the Crypto Provider, importing the Private Key, getting a handle to the Key Pair with CryptGetUserKey AT_KEYEXCHANGE, I get an Error 0x80090005 NTE_BAD_DATA when I try to import the encrypted MasterKey. I am having a great deal of difficulty troubleshooting this one, and any assistance would be greatly apprreciated.
Last edited by couttsj; July 9th, 2013 at 02:36 PM.