Using the Toolkit |
Your application can get information about certificate extensions for a specific certificate. Your application can do this by first getting a list of extensions using the Vtk_CertGetExtensions function which returns a Vtk_Extensions structure for the certificate. This structure contains the list of extensions that can be parsed using several of the extension functions. It represents X.509 extensions used in certificates, CRLs, and the OCSP and CRT protocols.
An application can obtain this structure using the Vtk_CertGetExtensions function or from the Vtk_ValRespDetails or Vtk_ValRespSingleCertDetails structure returned by the Vtk_CRLValidateCert, Vtk_ValidationGetRevStatus and Vtk_ValHdlGetRevStatus functions.
The Toolkit provides several other functions that allow your application to parse the Vtk_Extensions structure and return the following:
These search functions can be used to search a list of any type of extensions, that is certificate, OCSP, CRT, or CRL extensions.
The Vtk_ExtensionGetByOID can be used to search for a specific Object Identifier (OID) in the list of extensions currently in Vtk_Extensions structure. The OID can be specified in dot notation. The application must call Vtk_ExtensionDelete when finished with the returned structure, otherwise memory leaks and other problems can occur.
The Vtk_ExtensionsGetCount function can be used to determine the number of extensions currently in the Vtk_Extensions structure for the specified context. This function can be used to search a list of any type of extensions, that is certificate, OCSP, CRT, or CRL extensions.
The Vtk_ExtensionsGetith function can be used to search for a specific occurrence of an extension within the list of extensions currently in Vtk_Extensions structure. The application must call Vtk_ExtensionDelete when finished with the returned structure, otherwise memory leaks and other problems can occur.
This code sample demonstrates how to process extensions, get the number of extensions in the extension container, and access individual extensions in the extension container.
/*ValiCert, Inc. http://www.valicert.com Voice: +1.650.567.5469 Fax: (+1.650.254.2148 support@valicert.com |