Re: How to get key container or public key from CertificateContext?
From: Michel Gallant (neutron_at_istar.ca)
Date: 08/12/04
- Next message: tomas: "Ts web auto-logon"
- Previous message: Antony Perkov: "Schannel and client certificates"
- In reply to: Lokicer: "How to get key container or public key from CertificateContext?"
- Next in thread: Lokicer: "Re: How to get key container or public key from CertificateContext?"
- Reply: Lokicer: "Re: How to get key container or public key from CertificateContext?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 12 Aug 2004 14:52:53 -0400
Hi Zheng,
There are a few ways to do that.
>From capi you can call CertGetCertificateContextProperty() with
CERT_KEY_PROV_INFO_PROP_ID and if you get a valid result, you know
that cert has a keycontainer/private key associated with it.
>From the returned PCRYPT_KEY_PROV_INFO, get the member via:
PCRYPT_KEY_PROV_INFO ->ContainerName
Approach for .NET uses identical calls you would use in CryptoAPI.
See .NET "KeyPal" source code and function GetCertContainernames() therein:
http://www.jensign.com/JavaScience/dotnet/keypal
- Mitch
"Lokicer" <lokicer@163.com> wrote in message news:cfg1g4$i1c$1@mail.cn99.com...
> Hi,
>
> i want to encrypt/decrypt files use certificate in store. i read the sample
> code about how to do it in .NET platform. but i still don't know how to get
> the key container or public/private key from certificate in MY store in
> VC++6.0.
> any help is appreciated,
> Thanks in advance.
>
> Zheng
>
>
- Next message: tomas: "Ts web auto-logon"
- Previous message: Antony Perkov: "Schannel and client certificates"
- In reply to: Lokicer: "How to get key container or public key from CertificateContext?"
- Next in thread: Lokicer: "Re: How to get key container or public key from CertificateContext?"
- Reply: Lokicer: "Re: How to get key container or public key from CertificateContext?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|