ClientCertificateClientCertificate 集合從 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%> 應用于Request 對象 |
溫馨提示:喜歡本站的話,請收藏一下本站!