Visual FoxPro
Visual FoxPro
Find Certificate by Subject O (Organization)
See more Cert Store Examples
Demonstrates how to find a certificate having the specified subject organization.Note: Requires Chilkat v10.1.2 or later.
Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loCertStore
LOCAL lnReadOnly
LOCAL loJson
LOCAL lcOrganization
LOCAL loCert
lnSuccess = 0
loCertStore = CreateObject('Chilkat.CertStore')
* This opens the Current User certificate store on Windows,
* On MacOS and iOS it opens the default Keychain.
lnReadOnly = 0
lnSuccess = loCertStore.OpenCurrentUserStore(lnReadOnly)
IF (lnSuccess = 0) THEN
? loCertStore.LastErrorText
RELEASE loCertStore
CANCEL
ENDIF
* Find the certificate having a Subject O = "ICP-Brasil".
loJson = CreateObject('Chilkat.JsonObject')
lcOrganization = "ICP-Brasil"
loJson.UpdateString("O",lcOrganization)
loCert = CreateObject('Chilkat.Cert')
lnSuccess = loCertStore.FindCert(loJson,loCert)
IF (lnSuccess = 1) THEN
* Show the full distinguished name of the certificate.
? "Found: " + loCert.SubjectDN
ELSE
? "Not found."
ENDIF
RELEASE loCertStore
RELEASE loJson
RELEASE loCert