共用方式為


ICertificatePolicy.CheckValidationResult 方法

定義

驗證伺服器憑證。

public:
 bool CheckValidationResult(System::Net::ServicePoint ^ srvPoint, System::Security::Cryptography::X509Certificates::X509Certificate ^ certificate, System::Net::WebRequest ^ request, int certificateProblem);
public bool CheckValidationResult (System.Net.ServicePoint srvPoint, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Net.WebRequest request, int certificateProblem);
abstract member CheckValidationResult : System.Net.ServicePoint * System.Security.Cryptography.X509Certificates.X509Certificate * System.Net.WebRequest * int -> bool
Public Function CheckValidationResult (srvPoint As ServicePoint, certificate As X509Certificate, request As WebRequest, certificateProblem As Integer) As Boolean

參數

srvPoint
ServicePoint

要使用憑證的 ServicePoint

certificate
X509Certificate

做驗證的憑證。

request
WebRequest

接收憑證的要求。

certificateProblem
Int32

使用憑證時所遇到的問題。

傳回

如果接受憑證則為 true,否則為 false

備註

方法 CheckValidationResult 會實作應用程式憑證驗證原則。 方法可以檢查 srvPointcertificaterequest、 和 certificateProblem 參數,以判斷是否應接受憑證。

參數 certificateProblem 是安全性支援提供者介面, (SSPI) 狀態代碼。 如需詳細資訊,請參閱 MSDN 上的 SSPI 檔。

適用於