2010-07-29 78 views
0

大家好我敲了一个WCF服务和客户端。我也有一个课程来验证X509证书。我在哪里得到我的WCF服务来处理X509证书? C#.NET

这里是服务的Web.config文件中的一个片段:

<behavior name="HelloWorldWFC2.Service1Behavior"> 
<serviceCredentials> 
    <serviceCertificate findValue="Service" 
     x509FindType="FindBySubjectName" 
     storeLocation="CurrentUser" 
     storeName="My" /> 

    <clientCertificate> 
    <authentication certificateValidationMode="Custom" 
     customCertificateValidatorType="type" /> 
    </clientCertificate> 
</serviceCredentials> 
</behavior> 

但我不知道在哪里办理证书的接收?我认为有件事我specficially必须覆盖,因为显然没有处理它们允许任何连接等等,等等

最赞赏:)

回答

1

这customCertificateValidatorType属性允许你指定一个类的全名的任何帮助它来自X509CertificateValidator并决定它是否想接受证书。在WCF文档中有这样的example

请注意,如果你不想/确实需要,那么你可以设置certificateValidationMode为other possible values之一,有证书可以对证书存储区自动检查。

相关问题