ASP Request.ClientCertificate() - Request Object Gets the current request’s client security certificate.
ShotDev Focus:
- Get client security certificate
Syntax
Request.ClientCertificate(Key[SubField])
Key
Value | Meaning |
Certificate | A string containing the binary stream of the entire certificate content in ASN.1 format. This is useful to discover if special SubFields are present that are not listed below. |
Flags | A set of flags that provides additional client certificate information. If Flags is set to 1, a client certificate is present. If Flags is set to 2, the last certificate in this chain is from an unknown issuer. |
Issuer | A string that contains a list of subfield values containing information about the issuer of the certificate. If this value is specified without a SubField , the ClientCertificate collection returns a comma-separated list of subfields. For example, C=US, O=Verisign, and so on. |
SerialNumber | A string that contains the certification serial number as an ASCII representation of hexadecimal bytes separated by hyphens (-). For example, 04-67-F3-02. |
Subject | A string that contains a list of subfield values. The subfield values contain information about the subject of the certificate. If this value is specified without a SubField , the ClientCertificate collection returns a comma-separated list of subfields. For example, C=US, O=Msft, and so on. |
ValidFrom | A date specifying when the certificate becomes valid. This date follows VBScript format and varies with international settings. For example, in the United States, 9/26/96 11:59:59 P.M.. The year value is displayed as a four-digit number. |
ValidUntil | A date specifying when the certificate expires. The year value is displayed as a four-digit number. |
SubField
Value | Meaning |
C | Specifies the name of the country/region of origin. |
CN | Specifies the common name of the user. (This subfield is only used with the Subject key.) |
GN | Specifies a given name. |
I | Specifies a set of initials. |
L | Specifies a locality. |
O | Specifies the company or organization name. |
OU | Specifies the name of the organizational unit. |
S | Specifies a state or province. |
T | Specifies the title of the person or organization. |
Example
asp_request_clientcertificate.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim strKey For Each strKey in Request.ClientCertificate Response.Write strkey & " = " & Request.ClientCertificate(strkey) & "<BR>" Next %> </body> </html>
Create a asp file and save to path root-path/myphp/
Run
http://localhost/myasp/asp_request_clientcertificate.asp
.
.
.
1microscopic…
…