Sample code for 30+ languages & platforms
VBScript

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 VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

set cert = CreateObject("Chilkat.Cert")

success = cert.LoadByCommonName("PIVKey 7ED53EC611D3F84396212C5842BB563F")
If (success <> 1) Then
    outFile.WriteLine(cert.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine("Loaded: " & cert.SubjectDN)

outFile.Close