#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    45

    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.

    J.A. Coutts
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    45
    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.

    J.A. Coutts
    Last edited by couttsj; July 9th, 2013 at 01:36 PM.

IMN logo majestic logo threadwatch logo seochat tools logo