Sample code for 30+ languages & platforms
Visual FoxPro

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 Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loCert
LOCAL loPubkey

lnSuccess = 0

loCert = CreateObject('Chilkat.Cert')

lnSuccess = loCert.LoadFromFile("qa_data/pem/my_cert.pem")
IF (lnSuccess = 0) THEN
    ? loCert.LastErrorText
    RELEASE loCert
    CANCEL
ENDIF

loPubkey = CreateObject('Chilkat.PublicKey')
loCert.GetPublicKey(loPubkey)

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

RELEASE loCert
RELEASE loPubkey