Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
List Windows Local Machine CertificatesDemonstrates how to open the registry-based Local Machine certificate store on a Windows OS and list the digital certificates.
#include <C_CkCreateCS.h> #include <C_CkCertStore.h> #include <C_CkCert.h> void ChilkatSample(void) { HCkCreateCS ccs; HCkCertStore cs; HCkCert cert; long numCerts; long i; // This example demonstrates how to list the certificates // in a Windows Local Machine Certificate Store. // This is our certificate store factory object: ccs = CkCreateCS_Create(); CkCreateCS_putReadOnly(ccs,TRUE); // Open the local machine store: cs = CkCreateCS_OpenLocalSystemStore(ccs); if (!(cs == 0 )) { numCerts = CkCertStore_getNumCertificates(cs); // Print the distinguished name of each certificate for (i = 0; i <= numCerts - 1; i++) { cert = CkCertStore_GetCertificate(cs,i); printf("%s\n",CkCert_subjectDN(cert)); } } else { printf("%s\n",CkCreateCS_lastErrorText(ccs)); } // The Chilkat Certificate, Certificate Store, Private Key, // Public Key, and Key Container classes / objects are freeware. // They are used by and included with the Chilkat Email, // Crypt, S/MIME, and other commercial Chilkat components. CkCreateCS_Dispose(ccs); } |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.