PureBasic
PureBasic
Transition from Email.GetSignedByCert to Email.LastSignerCert
Provides instructions for replacing deprecated GetSignedByCert method calls with LastSignerCert.Chilkat PureBasic Downloads
IncludeFile "CkEmail.pb"
IncludeFile "CkCert.pb"
Procedure ChilkatExample()
success.i = 0
email.i = CkEmail::ckCreate()
If email.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; The GetSignedByCert method is deprecated:
certObj.i = CkEmail::ckGetSignedByCert(email)
If CkEmail::ckLastMethodSuccess(email) = 0
Debug CkEmail::ckLastErrorText(email)
CkEmail::ckDispose(email)
ProcedureReturn
EndIf
; ...
; ...
CkCert::ckDispose(certObj)
; ------------------------------------------------------------------------
; Do the equivalent using LastSignerCert.
; Your application creates a new, empty Cert object which is passed
; in the last argument and filled upon success.
certOut.i = CkCert::ckCreate()
If certOut.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkEmail::ckLastSignerCert(email,0,certOut)
If success = 0
Debug CkEmail::ckLastErrorText(email)
CkEmail::ckDispose(email)
CkCert::ckDispose(certOut)
ProcedureReturn
EndIf
CkEmail::ckDispose(email)
CkCert::ckDispose(certOut)
ProcedureReturn
EndProcedure