Naughter Software Logo

CSelectCertificateDlg v1.14 A certificate selection dialog class

Recently I've been doing quite a bit of work with TLS\SSL communications and the Windows Cryptography API in general. In one project I needed to present a dialog which allowed the end user to specify a certificate to use which was stored in one of the Certificate stores which Windows uses for persistence. To obtain the functionality I wanted, I ended up writing code which GetProcAddress'ed for 3 Windows Crypto API's namely "CryptUIDlgSelectCertificateFromStore" (which is only available on XP or 2003), "CertSelectCertificate" (which is available on Windows 2000 but which seems to be deprecated) and finally "CryptUIDlgSelectCertificateFromStore" (which also requires XP or 2003). Because the code would potentially be running on Windows 2000, I had to fall back on "CertSelectCertificate" as a last resort. This function unfortunately does not provide a way to customize which certificates are initially shown selected. I also tried getting the selection mechanism to work correctly using the pFilterCallback member of the structure you pass to "CryptUIDlgSelectCertificate" but it did not seem to work and ignored what settings I had passed to it. As time was tight with the project and there seemed to be very little samples for this area of the CryptoAPI, I decided to put up with the limitations of all the built in dialogs and vowed that I would revisit this area when I got time.

 

Thus was born this class which addresses all my perceived limitations of these built in dialogs. Here's what the dialog looks like running on a computer which has had a number of certificates installed:

 

Sample screen capture of CSelectCertificateDlg

 

The enclosed zip file contains the source and a sample dialog based appwizard generated application to show how to use it.

 

Features

 

Copyright

 

Updates

v1.14 (16 April 2022)

v1.13 (29 November 2021)

v1.12 (10 May 2020)

v1.11 (27 March 2020)

v1.10 (29 December 2019)

v1.09 (12 November 2019)

v1.08 (21 May 2019)

v1.07 (23 September 2018)

v1.06 (1 May 2017)

v1.05 (19 November 2015)

v1.04 (18 January 2015)

v1.03 (3 November 2012)

v1.02 (28 December 2008)

v1.01 (5 July 2007)

v1.0 (27 August 2006)