Sample code for 30+ languages & platforms
VB.NET

Transition from Cert.ExportPublicKey to Cert.GetPublicKey

Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

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
success = cert.GetPublicKey(publickeyOut)
If (success = False) Then
    Debug.WriteLine(cert.LastErrorText)
    Exit Sub
End If