Sample code for 30+ languages & platforms
VB.NET

Get Certificate Public Key from PEM

See more Certificates Examples

Demonstrates how to load a PEM file containing a certificate and access the public key.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim cert As New Chilkat.Cert

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


Dim pubkey As New Chilkat.PublicKey
cert.GetPublicKey(pubkey)

' Examine the public key as XML..
Debug.WriteLine(pubkey.GetXml())