Sample code for 30+ languages & platforms
Xojo Plugin

Transition from Cert.ExportPrivateKey to Cert.GetPrivateKey

Provides instructions for replacing deprecated ExportPrivateKey method calls with GetPrivateKey.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim cert As New Chilkat.Cert

// ------------------------------------------------------------------------
// The ExportPrivateKey method is deprecated:

Dim privatekeyObj As Chilkat.PrivateKey
privatekeyObj = cert.ExportPrivateKey()
If (cert.LastMethodSuccess = False) Then
    System.DebugLog(cert.LastErrorText)
    Return
End If

// ...
// ...

// ------------------------------------------------------------------------
// Do the equivalent using GetPrivateKey.
// Your application creates a new, empty PrivateKey object which is passed 
// in the last argument and filled upon success.

Dim privatekeyOut As New Chilkat.PrivateKey
success = cert.GetPrivateKey(privatekeyOut)
If (success = False) Then
    System.DebugLog(cert.LastErrorText)
    Return
End If