AutoIt
AutoIt
Load PFX/P12 from a Base64 Encoded PFX File
See more PFX/P12 Examples
Demonstrates how to call LoadPfxEncoded.Chilkat AutoIt Downloads
Local $bSuccess = False
$oBd = ObjCreate("Chilkat.BinData")
$bSuccess = $oBd.LoadFile("qa_data/pfx/cert_test123.pfx")
If ($bSuccess <> True) Then
ConsoleWrite("Failed to load PFX file." & @CRLF)
Exit
EndIf
; Get the bytes contained in the PFX in base64 format:
Local $strBase64 = $oBd.GetEncoded("base64")
; The base64 looks like this: "MIIbEAIBAzCCGswGCSqGSIb3DQEHAaCCGr0Eghq5MIIatTCCBg..."
ConsoleWrite($strBase64 & @CRLF)
$oPfx = ObjCreate("Chilkat.Pfx")
; Load the PFX from the base64 string
Local $sPassword = "test123"
$bSuccess = $oPfx.LoadPfxEncoded($strBase64,"base64",$sPassword)
If ($bSuccess <> True) Then
ConsoleWrite($oPfx.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("success" & @CRLF)