get_certificate_info
Returns information about the current client X509 certificate
integer or stringget_certificate_info
(in typeinteger,
in cert_or_key_namevarchar,
in in_formatint,
in passwdvarchar,
in ext_oidvarchar);
Description
This function will return information about the current client X509 certificate
(if successfully verified). If there is no valid X509 certificate or the requested
information is not available it will return NULL.
If the optional cert_or_key_name is supplied it should contain
a encoded certificate (by default format is PEM). The certificate info is read from the first certificate in
that string.
If the optional cert_or_key_name is supplied and in_format
is equal to 3 (integer) the function will try to retrieve the certificate registered in the current user's
key store by name contained in cert_or_key_name.
Parameters
type –
type must be an integer. It can be one of the following values:
- 1 - return the certificate serial number as an integer
- 2 - return the certificate subject name as a string
- 3 - return the certificate issuer name as a string
- 4 - return the certificate validity period start date as a string
- 5 - return the certificate validity period end date as a string
- 6 - return the certificate fingerprint
- 7 - return the certificate extension value by OID
- 8 - return the certificate name of the key from current user store
- 9 - return a vector of three elements: the certificate's public key type, modulus and exponent
cert_or_key_name –
A string containing an encoded X.509 certificate or name of a key from
current user store.
in_format –
This is to designate encoding type of the value 'cert_or_key_name'
- 0 (default) - PEM
- 1 - DER (raw)
- 2 - PKCS#12
- 3 - the 'cert_or_key_name' is a name of a key from user's key store
passwd –
Password to unlock PKCS#12 encoded certificate
ext_oid –
X.509 extension object identifier
Return Types
The requested information or NULL if the certificate is found to be invalid.