Sample code for 30+ languages & platforms
Xojo Plugin

Get Certificate Policy

See more Certificates Examples

Demonstrates how to get a certificate's policy OIDs (if any)

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim cert As New Chilkat.Cert

success = cert.LoadFromFile("qa_data/certs/sample.cer")
If (success = False) Then
    System.DebugLog(cert.LastErrorText)
    Return
End If

// The certificatePolicies OID is 2.5.29.32
Dim oid As String
oid = "2.5.29.32"
Dim strXml As String
strXml = cert.GetExtensionAsXml(oid)
If (cert.LastMethodSuccess = True) Then
    System.DebugLog(strXml)

    // Sample result:
    // <sequence><sequence><oid>2.16.840.1.101.2.1.11.39</oid></sequence></sequence>

    Dim xml As New Chilkat.Xml
    success = xml.LoadXml(strXml)
    System.DebugLog("Policy OID = " + xml.GetChildContent("sequence|oid"))
End If