RE: How to determin a cert in personal store does have private key?

From: cyberninja (cyberninja_at_discussions.microsoft.com)
Date: 09/27/04


Date: Mon, 27 Sep 2004 14:05:04 -0700


>From MSDN "
CERT_KEY_PROV_HANDLE_PROP_ID, CERT_KEY_PROV_INFO_PROP_ID, and
CERT_KEY_CONTEXT_PROP_ID
These properties tie a certificate to a particular CSP and, within that CSP,
to a particular private key."

However, I don't know if I can use the existance of 0-3 of the above prop
ids to determine if a private key is available. In my basic test, it seems
that CERT_KEY_PROV_INFO_PROP_ID is requried for a cert with provate key. Is
that right?

"cyberninja" wrote:

> How to determin a cert in personal store does have private key? I know I an
> use CryptAcquireCertificatePrivateKey(), but is there an alternative way to
> do this? (just check if the private key exists)
>
> Thanks



Relevant Pages

  • Re: A question about CryptAcquireCertificatePrivateKey
    ... Windows stores the CSP and private key associated with the certificate in the ... This is, of course, true only when WINDOWS stores the cert. ...
    (microsoft.public.platformsdk.security)
  • Re: Alternative store vs. MY store
    ... store both the client cert and its associate private key on my USB memory ... your codes (CSP, ... indirect call to your CSP when one of your cert is involved in an operation. ...
    (microsoft.public.platformsdk.security)
  • Re: storing keys
    ... When the RSA key is generated both public and private keys are generated. ... There's no point in generating a private key only since one couldn't ... The CSP should not generate ... > when i import a certificate with private key, ...
    (microsoft.public.platformsdk.security)
  • Re: importing private key globally to personal store
    ... The Certificate Store doesn't store private keys, so you won't see them in ... your certificate has an associated private key, ... Store will have pointers to the CSP where the private key is maintained. ...
    (microsoft.public.platformsdk.security)
  • Re: Changing the CSP for a certificate
    ... I might be wrong but I think you'll have to export certificate and the ... private key to PKCS#12 file and then import the combo into the other one. ... I'm not sure how to do that, but I'm sure that CSP is set at the time of the ... > accepted the "Microsoft Base Cryptographic provider v1.0" CSP. ...
    (microsoft.public.security)