Xbase++
Xbase++
Get Issuer Certificate Information
See more Certificates Examples
A certificate contains information about its issuer. This example demonstrates how to get the issuer information from a certificate.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oCert
nSuccess := 0
oCert := CreateObject("Chilkat.Cert")
nSuccess := oCert:LoadFromFile("qa_data/certs/sample.cer")
IF (nSuccess == 0)
? oCert:LastErrorText
oCert:destroy()
RETURN
ENDIF
// Get issuer information:
// -----------------------------------------------------------------------
// (Not all subject fields may exist depending on the issuer certificate.)
// -----------------------------------------------------------------------
// Issuer DN (Distinguished Name, i.e. all the Issuer subject parts)
? "DN: " + oCert:IssuerDN
// Common Subject parts:
// Issuer Common Name
? "CN: " + oCert:IssuerCN
// Issuer Country
? "C: " + oCert:IssuerC
// Issuer Email address
? "E: " + oCert:IssuerE
// Issuer Locality
? "L: " + oCert:IssuerL
// Issuer Organization
? "O: " + oCert:IssuerO
// Issuer Organizational Unit
? "OU: " + oCert:IssuerOU
// Issuer State
? "S: " + oCert:IssuerS
oCert:destroy()