Sample code for 30+ languages & platforms
Visual Basic 6.0

Load a Certificate from the Windows Certificate Store

See more Certificates Examples

Demonstrates how to load a certificate that has been pre-installed in the registry-based Windows certificate store. This is generally how one would load a certificate that is stored on a smart card or usb token.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim cert As New ChilkatCert

success = cert.LoadByCommonName("PIVKey 7ED53EC611D3F84396212C5842BB563F")
If (success <> 1) Then
    Debug.Print cert.LastErrorText
    Exit Sub
End If

Debug.Print "Loaded: " & cert.SubjectDN