read client certificate from httprequest C#

后端 未结 4 1173
陌清茗
陌清茗 2021-02-03 11:26

I am trying to read an X509 certificate using Request.ClientCertificate but nothing is returned. The certificate is definitely being attached to the request because I can get th

4条回答
  •  不思量自难忘°
    2021-02-03 11:38

    I wrote a identification web page a while back that looked for a client certificate and if found would display the certificate information. I believe that is what you are looking for... Here is the page:

    <%@ Page Language="C#" Trace="false" %>
    
    <%@ Import Namespace="System.Security.Cryptography.X509Certificates" %>
    <%@ Import Namespace="System.Security.Cryptography" %>
    
    
    
      
        <% Page.Response.Write(System.Environment.MachineName); %>
      
      
          <% LoadCertInfo();  %>
      
    
    

提交回复
热议问题