(Visual FoxPro) Get Certificate Policy
Demonstrates how to get a certificate's policy OIDs (if any)
LOCAL loCert
LOCAL lnSuccess
LOCAL lcOid
LOCAL lcStrXml
LOCAL loXml
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Cert')
loCert = CreateObject('Chilkat.Cert')
lnSuccess = loCert.LoadFromFile("qa_data/certs/sample.cer")
IF (lnSuccess = 0) THEN
? loCert.LastErrorText
RELEASE loCert
CANCEL
ENDIF
* The certificatePolicies OID is 2.5.29.32
lcOid = "2.5.29.32"
lcStrXml = loCert.GetExtensionAsXml(lcOid)
IF (loCert.LastMethodSuccess = 1) THEN
? lcStrXml
* Sample result:
* <sequence><sequence><oid>2.16.840.1.101.2.1.11.39</oid></sequence></sequence>
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Xml')
loXml = CreateObject('Chilkat.Xml')
loXml.LoadXml(lcStrXml)
? "Policy OID = " + loXml.GetChildContent("sequence|oid")
ENDIF
RELEASE loCert
RELEASE loXml
|