Re: Server Authentication certificates

From: Shawn Corey [MSFT] (shawncor_at_online.microsoft.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 12:44:50 -0800

Instead of Enuming all the certs and manually checking have you tried
CertFindCertificateInStore with the CERT_FIND_CTL_USAGE flag?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/certfindcertificateinstore.asp

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Varun" <anonymous@discussions.microsoft.com> wrote in message
news:EBC9BE2B-8DF0-4D79-B861-C8E4808A0067@microsoft.com...
> Hi,
>
> I am able to enumerate all certificates in the computer's local store
using CertEnumCertificatesInStore. I want to limit my selection to only
those certificates which are intended for "Server Authentication".
(certificates used for IPSec, client authentication, etc should not be
included) I tried looping through the entire list and doing a
CertGetCertificateContextProperty for properties CERT_DESCRIPTION_PROP_ID
and CERT_ENHKEY_USAGE_PROP_ID. However none of my certificates had these
properties set. In the MMC I can see Intended Purposes for all the
certificates . How do I get this programatically for each certificate? (I
cannot use .NET, only WIN 32 APIs)
>
> Thanks in advance.
>
>