Sample code for 30+ languages & platforms
Xojo Plugin

Load PFX/P12 from a Base64 Encoded PFX File

See more PFX/P12 Examples

Demonstrates how to call LoadPfxEncoded.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim bd As New Chilkat.BinData

success = bd.LoadFile("qa_data/pfx/cert_test123.pfx")
If (success <> True) Then
    System.DebugLog("Failed to load PFX file.")
    Return
End If

// Get the bytes contained in the PFX in base64 format:
Dim strBase64 As String
strBase64 = bd.GetEncoded("base64")

// The base64 looks like this:  "MIIbEAIBAzCCGswGCSqGSIb3DQEHAaCCGr0Eghq5MIIatTCCBg..."
System.DebugLog(strBase64)

Dim pfx As New Chilkat.Pfx

// Load the PFX from the base64 string
Dim password As String
password = "test123"
success = pfx.LoadPfxEncoded(strBase64,"base64",password)
If (success <> True) Then
    System.DebugLog(pfx.LastErrorText)
    Return
End If

System.DebugLog("success")