Sample code for 30+ languages & platforms
Lianja

Load PEM Format Certificate (.pem)

See more Certificates Examples

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

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loCert = createobject("CkCert")

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

llSuccess = loCert.LoadFromFile("/Users/chilkat/testData/cer/cert.pem")
if (llSuccess <> .T.) then
    ? loCert.LastErrorText
    release loCert
    return
endif

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

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

? "Serial Number:" + loCert.SerialNumber


release loCert