Sample code for 30+ languages & platforms
AutoIt

Load PFX (PKCS#12) and List Certificates

See more Certificates Examples

Loads a PFX file (.pfx, .p12) and iterates over the certificates found within.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oCertStore = ObjCreate("Chilkat.CertStore")

Local $sPfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx"
Local $sPfxPassword = "test"
$bSuccess = $oCertStore.LoadPfxFile($sPfxPath,$sPfxPassword)
If ($bSuccess <> True) Then
    ConsoleWrite($oCertStore.LastErrorText & @CRLF)
    Exit
EndIf

Local $iNumCerts = $oCertStore.NumCertificates

ConsoleWrite("PFX contains " & $iNumCerts & " certificates" & @CRLF)

$oCert = ObjCreate("Chilkat.Cert")
Local $i = 0
While $i < $iNumCerts
    $oCertStore.GetCert($i,$oCert)

    ConsoleWrite($i & ": (Common Name) " & $oCert.SubjectCN & @CRLF)
    ConsoleWrite($i & ": (Serial Number) " & $oCert.SerialNumber & @CRLF)
    ConsoleWrite($i & ": (Distinguished Name) " & $oCert.SubjectDN & @CRLF)

    $i = $i + 1
Wend