Sample code for 30+ languages & platforms
Lianja

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

Lianja
llSuccess = .F.

loCert = createobject("CkCert")

llSuccess = loCert.LoadFromFile("qa_data/pem/my_cert.pem")
if (llSuccess = .F.) then
    ? loCert.LastErrorText
    release loCert
    return
endif

loPubkey = createobject("CkPublicKey")
loCert.GetPublicKey(loPubkey)

// Examine the public key as XML..
? loPubkey.GetXml()


release loCert
release loPubkey