ClientCertificate

The ClientCertificate collection retrieves the certification fields (specified in the X.509 standard) from the request issued by the Web browser.

If a Web browser uses the SSL3/PCT1 protocol (in other words, it uses a URL starting with 塗ttps:// instead of 塗ttp://) to connect to a server and the server requests certification, the browser sends the certification fields.

If no certificate is sent, the ClientCertificate collection returns EMPTY.

Syntax

Request.ClientCertificate( Key[SubField] )

Parameters

Key
Specifies the name of the certification field to retrieve. A client certificate consists of the following fields.

Value

Meaning

Subject

A string that contains a list of subfield values that themselves 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: 鼎=US, O=Msft, .

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: 鼎=US, O=Verisign, .

ValidFrom

A date specifying when the certificate becomes valid. This date follows VBScript format and varies with international settings. For example: in the U.S.: 9/26/96 11:59:59 PM.

ValidUntil

A date specifying when the certificate expires.

SerialNumber

A string that contains the certification serial number as an ASCII representation of hexidecimal bytes separated by hyphens (-). For example: 04-67-F3-02.

Certificate

A string containing the binary stream of the entire certificate content in ASN.1 format.

SubField
An optional parameter you can use to a retrieve an individual field in either the 鉄ubject or 的ssuer keys. This parameter is added to the Key parameter as a suffix. For example: 的ssuerO or 鉄ubjectCN. The following table lists some common SubField values.

Value

Meaning

C

Specifies the name of the country of origin.

O

Specifies the company or organization name.

OU

Specifies the name of the organizational unit.

CN

Specifies the common name of the user. (This subfield is only used with the 鉄ubject key.)

L

Specifies a locality.

S

Specifies a state or province.

T

Specifies the title of the person or organization.

GN

Specifies a given name.

I

Specifies a set of initials.

SubField values other than those listed in the preceding table can be identified by their ASN.1 identifier. The format of the ASN.1 identifier is a list of numbers separated by a period (.). For example: 3.56.7886.34.

Remarks

You can use an iterator to loop through the keys of the ClientCertificate collection. This is demonstrated in the following example.

<%
For Each key in Request.ClientCertificate("key")
   Response.Write( key & ": " & Request.ClientCertificate("key"))
Next
%>
 

Examples

The following example retrieves the common name of the company that issued the client certificate.

<%= Request.ClientCertificate("IssuerCN") %>
 

The following example checks the organization name of the subject of the client certification.

<% 
If (Request.ClientCertificate("SubjectO")="Msft")
   Response.Write("Good Choice!")
End if
%>
 

The following example displays the expiration date of the client certificate.

This certification will expire on 
<%= Request.ClientCertificate("ValidUntil") %>
 

Applies To

Request Object

See Also

Cookies, Form, QueryString, ServerVariables