Sample code for 30+ languages & platforms
VB.NET

Get Public Key from Certificate PEM

See more Certificates Examples

Loads a certificate from a PEM file and gets the cert's public key.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim cert As New Chilkat.Cert

success = cert.LoadFromFile("qa_data/certs/someCert.pem")
If (success = False) Then
    Debug.WriteLine(cert.LastErrorText)
    Exit Sub
End If


' Get the certificate's public key:
Dim pubkey As New Chilkat.PublicKey
cert.GetPublicKey(pubkey)

Debug.WriteLine(pubkey.GetPem(False))

' OK.. we have the public key which can be used in other Chilkat classes/methods...