(VB.NET) 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 Chilkat.Cert
' ------------------------------------------------------------------------
' The ExportPublicKey method is deprecated:
Dim publickeyObj As Chilkat.PublicKey = cert.ExportPublicKey()
If (cert.LastMethodSuccess = False) Then
Debug.WriteLine(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 Chilkat.PublicKey
Dim success As Boolean = cert.GetPublicKey(publickeyOut)
If (success = False) Then
Debug.WriteLine(cert.LastErrorText)
Exit Sub
End If
|