好的,您正在寻找潜在客户的客户证书身份验证,其中始终包括 SSL。
我有几个链接供您查看:
http://msdn.microsoft.com/en-us/library/ms731074(v=vs.110).aspx 是来自 MS 的官方版本,它有很好的信息,但不一定是关于让它工作的很好的说明。
和
http://architecturebyashwani.blogspot.de/2010/01/wcf-client-authentication-using-x509.html ...在我看来,这是一个更好的来源,因为它将引导您完成设置测试所需的证书(自签名)的过程。
就控制客户端计算机的颁发和证书而言,这可能是容易的还是困难的,具体取决于所涉及的客户端设备的数量和它们所在的位置。
如果您谈论的是网络内服务器到服务器通信的内部实现,或者可能是几台 PC 连接到主机,那并不太难。简而言之,您将 .PFX 文件(证书和私钥)复制到客户端和主机,并将它们设置在证书存储区(例如 LocalComputer\Trusted)。然后,您将客户端和主机 WCF 软件设置为 a) 访问证书和 b) 使主机拒绝未经身份验证的用户的访问。
但是,如果您要为一千名携带 iPhone、Android 和笔记本电脑四处走动的人颁发和管理证书,这将是一个更难控制的提议。
这里有一个关于设置内部证书颁发机构的链接:
http://technet.microsoft.com/en-us/library/ff849263(v=ws.10).aspx
添加:此 DOS 脚本将创建客户端身份验证证书,将它们打包为 PFX 并将它们安装到主机上的证书存储中。
在主机端你这样做:
rem Comment -- creates client authentication cert, puts it in the currentuser\root authority and signs it based on the other certificate
makecert.exe -n cn=ClientAuthCert ClientAuthCert.cer -is root -sky exchange -pe -sv ClientAuthCert.pvk -eku 1.3.6.1.5.5.7.3.2
rem Comment -- make the pfx file that will allow you to copy certs around with private keys
pvk2pfx -pvk ClientAuthCert.pvk -spc ClientAuthCert.cer -pfx ClientAuthCert.pfx -f
rem Comment -- installs the certificate on the host in the localmachine / trusted people store
certmgr.exe -add ClientAuthCert.cer -c -s -r LocalMachine TrustedPeople
在客户端,您执行此操作(将 .CER 和 .PFX 文件复制到客户端计算机之后):
rem comment -- these lines install the certificates in the stores on the client device
certmgr.exe -add ClientAuthCert.cer -c -s -r LocalMachine TrustedPeople
Certmgr.exe -add ClientAuthCert.pfx -c -s -r CurrentUser My