[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: How do I retrieve the private key?
From:       Eric Rosenquist <eric () ROSENQUIST ! COM>
Date:       1998-06-25 19:18:48
[Download RAW message or body]


First, get a handle to the certificate (a PCCERT_CONTEXT) in the
CryptoAPI certificate store if you don't already have one. The
CertFindCertificateInStore() function is useful here.

Once you've got a PCCERT_CONTEXT you can call
CertGetCertificateContextProperty() to ask for the
CERT_KEY_PROV_INFO_PROP_ID property.  If the certificate has an
associated CryptoAPI CSP and key container (which is where the private
key lives) you'll get back a CRYPT_KEY_PROV_INFO structure which will
give you everything you need to do a CryptAcquireContext() call to get
at the private key.

Eric
---
Eric Rosenquist, Entrust Technologies  http://www.entrust.com/
mailto:Eric.Rosenquist@entrust.com     Telephone: 613-591-1922
Quote: God bless those pagans. -- Homer Simpson


-----Original Message-----
From: Kwok Lee [mailto:Kwok_Lee@BAYNETWORKS.COM]
Sent: Thursday, June 25, 1998 06:35
To: Microsoft Cryptographic API
Subject: How do I retrieve the private key?


Hi,

How do I retrieve the private key which associates with a particular
certificate?


Thanks in advance!
kclee

----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic