CryptoSys PKI Pro Manual

X509.QueryCert Method

Query an X.509 certificate file for selected information.

Syntax

[C#]
public static string QueryCert(
   string certFile,
   string query,
   X509.OutputOpts outOpts = X509.OutputOpts.Default 
)
[VB]
Public Shared Function QueryCert (
   certFile As String,
   query As String,
   Optional outOpts As X509.OutputOpts = X509.OutputOpts.Default 
) As String

Parameters

certFile  String
Filename of certificate file (or its base64 representation)
query  String
Query string (case insensitive)
outOpts  X509.OutputOpts  (Optional)
Optional options for output (default = 0)

Return Value

String
String containing the result, or an empty string if query not found or on error.

Remarks

Both binary BER and PEM-format certificates can be read, as can a base64 representation of the certificate.

Valid queries are:

QueryResult
"version"X.509 version number, e.g. "3".
"serialNumber"Serial number in hex-encoded format.
"signatureAlgorithm"Signature algorithm used, e.g. "sha1WithRSAEncryption".
"signatureValue"Signature value in hex-encoded format.
"notBefore"Date on which the certificate validity period begins in ISO format yyyy-mm-ddThh:nn:ssZ
"notAfter"Date on which the certificate validity period ends in ISO format yyyy-mm-ddThh:nn:ssZ
"issuerName"Distinguished name (DN) of entity who has signed and issued the certificate.
"subjectName"Distinguished name (DN) of the subject.
"subjectPublicKeyAlgorithm"Algorithm used in subject's public key, e.g. "dsa".
"subjectKeyIdentifier"The subject key identifier extension, if present, in hex-encoded format.
"authorityKeyIdentifier"The authority key identifier extension, if present, in hex-encoded format.
"rfc822Name"Internet mail address contained in a subjectAltName extension, if present.
"isCA"Returns "1" if the subject type is a CA, otherwise returns "0".
"keyUsageString"keyUsage flags in text format, e.g. "digitalSignature,nonRepudiation".
"extKeyUsageString"extKeyUsage purposes in text format, e.g. "codeSigning,timeStamping".
"cRLDistributionPointsURI"First URI found in cRLDistributionPoints, if any.
"authorityInfoAccessURI"First URI found in authorityInfoAccess, if any.
"subjectAltName"Subject alternative name extension, if present.
"hashAlgorithm"Hash algorithm used in signature, e.g. "sha256".
"pssParams"Parameters used for RSA-PSS (if applicable).

See Also

VB6/C equivalent: X509_QueryCert

[Contents] [Index]

[PREV: X509.MakeCertSelf Method...]   [Contents]   [Index]   
   [NEXT: X509.ReadCertStringFromP7Chain Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.