Request 对象之ClientCertificate集合
|
源代码网整理以下ClientCertificate 集合从 Web 浏览器发布请求中获取验证字段(由 X.509 标准指定)。 源代码网整理以下 源代码网整理以下如果 Web 浏览器使用 SSL3.0/PCT1 协议(也就是说,它使用以 https:// 开头的 URL,而不是 http://)连接服务器及服务器请求验证,则浏览器将发送验证字段。 源代码网整理以下如果没有发送验证,ClientCertificate 集合将返回 EMPTY。 源代码网整理以下必须先将 Web 服务器配置为要求客户端验证,然后才能使用 ClientCertificate 集合。 语法Request.ClientCertificate( Key[SubField] ) 参数
注释源代码网整理以下可以通过关键字用循环来遍历 ClientCertificate 集合。下面的例子对此进行演示。 <% For Each key in Request.ClientCertificate Response.Write( key & ": " & Request.ClientCertificate(key) & "<BR>") Next %> 示例源代码网整理以下下面的示例使用 <%
If Len(Request.ClientCertificate("Subject")) = 0
Response.Write("No client certificate was presented")
End if
%>
源代码网整理以下下面的示例获取发布客户端验证的公司的公用名。 <%= Request.ClientCertificate("IssuerCN") %>
源代码网整理以下下面的示例检查客户端验证主题的组织名。 <%
If (Request.ClientCertificate("Subject")="Msft")
Response.Write("Good Choice!")
End if
%>
源代码网整理以下下面的示例显示客户端验证何时到期。 This certification will expire on
<%= Request.ClientCertificate("ValidUntil") %>
源代码网整理以下下面的示例使用 <!--#include file="cervbs.inc" -->
<%
If Request.ClientCertificate("Flags") and ceUnrecognizedIssuer then
Response.Write "Unrecognized issuer"
End If
%>
源代码网供稿. |
