Search code examples
asp.netcacserver-variablesrequest.servervariables

When I use Request.ServerVariables("CERT_SUBJECT"), what does the value C=US mean?


When I use Request.ServerVariables("CERT_SUBJECT") I end up getting something like this as a string:

C=US, O=XXX, OU=XXX, OU=XXX, OU=XXX, CN=DOE.JOHN.JACOB.9999999

what does the value C=US mean? is this the cardholder's citizenship? The country of the card's origin?

Thank you for the help


Solution

  • Request.ServerVariables("CERT_SUBJECT") gives you:

    Subject field of the client certificate.

    see Server Variables.

    And C specifies CountryName according to here:

    An X.509 certificate consists of a number of fields. The Subject field is the one of most relevance to this tutorial. It gives the DName of the client to which the certificate belongs. A DName is a unique name given to an X.500 directory object. It consists of a number of attribute-value pairs called Relative Distinguished Names (RDNs). Some of the most common RDNs and their explanations are as follows:

    CN: CommonName
    OU: OrganizationalUnit
    O: Organization
    L: Locality
    S: StateOrProvinceName
    C: CountryName
    

    See also What does "subject" mean in certificate?