(Visual Basic 6.0) Transition from Cert.ExportPublicKey to Cert.GetPublicKey
Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey. Note: This example requires Chilkat v11.0.0 or greater.
Dim cert As New ChilkatCert
' ------------------------------------------------------------------------
' The ExportPublicKey method is deprecated:
Dim publickeyObj As PublicKey
Set publickeyObj = cert.ExportPublicKey()
If (cert.LastMethodSuccess = 0) Then
Debug.Print cert.LastErrorText
Exit Sub
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using GetPublicKey.
' Your application creates a new, empty PublicKey object which is passed
' in the last argument and filled upon success.
Dim publickeyOut As New PublicKey
Dim success As Long
success = cert.GetPublicKey(publickeyOut)
If (success = 0) Then
Debug.Print cert.LastErrorText
Exit Sub
End If
|