Sample code for 30+ languages & platforms
Xojo Plugin

Load Certificate from .cer and Private Key from .pem

See more Certificates Examples

Load a certificate from a .cer and its associated private key from a .pem.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim cert As New Chilkat.Cert
success = cert.LoadFromFile("C:/certs_and_keys/Certificate.cer")
If (success = False) Then
    System.DebugLog(cert.LastErrorText)
    Return
End If

Dim sbPem As New Chilkat.StringBuilder
success = sbPem.LoadFile("C:/certs_and_keys/PrivateKey.pem","utf-8")
If (success = False) Then
    System.DebugLog("Failed to load private key PEM")
    Return
End If

success = cert.SetPrivateKeyPem(sbPem.GetAsString())
If (success = False) Then
    System.DebugLog(cert.LastErrorText)
    Return
End If

System.DebugLog("The certificate and associated private key are now loaded and ready for signing.")