Sample code for 30+ languages & platforms
B4X Requires Chilkat v11.0.0+

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 B4X Downloads

B4X
Dim success As Boolean = False

Dim cert As ChilkatCert
cert.Initialize("cert")

success = cert.LoadFromFile("qa_data/pem/my_cert.pem")
If success = False Then
    Log(cert.LastErrorText)
    Return
End If


Dim pubkey As ChilkatPublicKey
pubkey.Initialize
cert.GetPublicKey(pubkey)

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