Sample code for 30+ languages & platforms
Visual FoxPro

Load PEM Format Certificate (.pem)

See more Certificates Examples

Loads a PEM format digital certificate and fetches information about the cert.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loCert

lnSuccess = 0

loCert = CreateObject('Chilkat.Cert')

* LoadFromFile will load virtually any certificate format file.
* It will auto-recognize the format and load appropiately.

lnSuccess = loCert.LoadFromFile("/Users/chilkat/testData/cer/cert.pem")
IF (lnSuccess <> 1) THEN
    ? loCert.LastErrorText
    RELEASE loCert
    CANCEL
ENDIF

* DN = "Distinguished Name"
? "SubjectDN:" + loCert.SubjectDN

? "Common Name:" + loCert.SubjectCN
? "Issuer Common Name:" + loCert.IssuerCN

? "Serial Number:" + loCert.SerialNumber

RELEASE loCert