---
title: "Viewing Client Certificate."  
description: "With the help of this program we can view Client Certificateand user name. In this demonstration we check whether client system has anappropriate cert"  
author: "Anonymous User"  
published: 2011-02-18  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/122/viewing-client-certificate  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Viewing Client Certificate.

With the help of this [program](https://www.mindstick.com/blog/12337/scaling-up-your-mentorship-program) we can [view](https://yourviews.mindstick.com/view/84701/layoffs-in-google-india-2023-view) [Client](https://www.mindstick.com/articles/12905/fynsis-announce-suitecrm-customer-portal-independent-client-service-platform) Certificateand [user name](https://www.mindstick.com/interview/33836/how-to-check-current-user-name-of-database-in-sql-server). In this demonstration we [check whether](https://www.mindstick.com/forum/157543/write-a-java-program-to-check-whether-a-string-is-a-palindrome) client [system](https://www.mindstick.com/articles/23411/the-most-effective-method-to-find-the-perfect-small-business-phone-system-for-your-business) has anappropriate [certificate](https://answers.mindstick.com/qa/47627/explain-briefly-about-urgency-certificate) or not.

```
public voiddisplayCeartificate(){        string userName = User.Identity.Name;   //Get Client Nameas Identity       Response.Write("Hello User  : " + userName + "<br />");  // Display AMessage To User.        HttpClientCertificate cert =Request.ClientCertificate;  //Create an HttpClientCeartificate object.        if (cert.IsPresent) //Check Whether Certificate Exist Or Not.        {           Response.Write(cert.Get("SUBJECT0"));  //If Exist Then Write Certificate Message.        }        else        {           Response.Write("No CeartificateFound.");  //Other Wise Display No Certificate Found.        }}
```

---

Original Source: https://www.mindstick.com/blog/122/viewing-client-certificate

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
