Sample code for 30+ languages & platforms
Lianja

Transition from Cert.ExportPublicKey to Cert.GetPublicKey

Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loCert = createobject("CkCert")

// ------------------------------------------------------------------------
// The ExportPublicKey method is deprecated:

loPublickeyObj = loCert.ExportPublicKey()
if (loCert.LastMethodSuccess = .F.) then
    ? loCert.LastErrorText
    release loCert
    return
endif

// ...
// ...

release loPublickeyObj

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

loPublickeyOut = createobject("CkPublicKey")
llSuccess = loCert.GetPublicKey(loPublickeyOut)
if (llSuccess = .F.) then
    ? loCert.LastErrorText
    release loCert
    release loPublickeyOut
    return
endif



release loCert
release loPublickeyOut