Sample code for 30+ languages & platforms
PowerShell

List Certificates in the Current User Certificate Store (Windows Only)

See more Certificates Examples

This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

# This is a Windows-only example because it lists the certificates
# stored in the Windows Current User Certificate Store located in the
# Windows Registry.

$certStore = New-Object Chilkat.CertStore

$readOnly = $true
$success = $certStore.OpenCurrentUserStore($readOnly)
if ($success -eq $false) {
    $($certStore.LastErrorText)
    exit
}

$cert = New-Object Chilkat.Cert
$numCerts = $certStore.NumCertificates
$i = 0
while ($i -lt $numCerts) {
    $certStore.GetCert($i,$cert)
    $("DN = " + $cert.SubjectDN)
    $("Email = " + $cert.SubjectE)
    $i = $i + 1
}