WCF建证书步骤

建立证书要三个文件:

先把两个文件(makecert.exe,CertMgr.exe)复制到C:\ProgramData

1. create_cert_step1.bat

/*

c:
cd\
cd ProgramData
makecert -n "CN=HOHCS_RootCA" -r -sv HOHCS_RootCA.pvk HOHCS_RootCA.cer
pause

*/

 

2.create_cert_step2.txt

/*

参考操作:
http://msdn.microsoft.com/en-us/library/ff648498.aspx

1.Copy the RootCATest.cer file to the client and server machines.
2.Click Start and then click Run.
3.In the command line, type MMC and then click OK.
4.In the Microsoft Management Console (MMC), on the File menu, click Add/Remove Snap-in.
5.In the Add Remove Snap-in dialog box, click Add.
6.In the Add Standalone Snap-in dialog box, select Certificates and then click Add.
7.In the Certificates snap-in dialog box, select the Computer account radio button because the certificate needs to be made available to all users, and then click Next.
8.In the Select Computer dialog box, leave the default Local computer: (the computer this console is running on) selected and then click Finish.
9.In the Add Standalone Snap-in dialog box, click Close.
10.In the Add/Remove Snap-in dialog box, click OK.
11.In the left pane, expand the Certificates (Local Computer) node, and then expand the Trusted Root Certification Authorities folder.
12.Under Trusted Root Certification Authorities, right-click the Certificates subfolder, select All Tasks, and then click Import.
13.On the Certificate Import Wizard welcome screen, click Next.
14.On the File to Import screen, click Browse.
15.Browse to the location of the signed Root Certificate Authority RootCATest.cer file copied in Step 1, select the file, and then click Open.
16.On the File to Import screen, click Next.
17.On the Certificate Store screen, accept the default choice and then click Next.
18.On the Completing the Certificate Import Wizard screen, click Finish.

*/

 

 

3. create_cert_step3.bat

/*

set SERIVCE_CERT_NAME=HOHCS_WCFService_Cert
c:
cd\
cd ProgramData
makecert -sk HOHCS_CertForSTMS -iv HOHCS_RootCA.pvk -n CN=%SERIVCE_CERT_NAME% -ic HOHCS_RootCA.cer -sr LocalMachine -ss My -sky exchange -pe
pause

*/

 

Note:
1. 导入证书路径:MMC-->控制台-->受信任的根证书颁发机构-->证书(这是第二导入证书)


2.做好证书后,文件夹要授权。
A. 如果是Win Xp /2003:
在C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA下为文件夹 MachineKeys 添加Everyone 并赋予浏览权限

B. 如果Win 7 /Vista /2008:
在C:\ProgramData\Microsoft\Crypto\RSA 目录下为文件夹 MachineKeys 添加Everyone 并赋予浏览权限

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值