用Windows Server 2012 R2 搭建二层证书服务结构 Part 4

为CA02在CA01根CA上申请证书:

  • 将上一节中生成的req文件拷贝到CA01上:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务

  • 登录CA01,以管理员身份打开powershell,输入:

certreq -submit C:\CA02.contoso.com_contoso-CA02-CA.req

  • 在弹出的窗口点确定:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_02

记住此处的RequestID:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_03

  • 此时看到挂起的证书中有我们的证书了:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_04

  • 右键点击该证书选择颁发:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_05

  • 在颁发的证书中,找到我们的证书,记住这个请求ID 2

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_06

  • 在CA01上以管理员身份打开CMD,输入:

certreq –retrieve 2 C:\CA02.contoso.com_contoso-CA02-CA.crt.

导出证书:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_07

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_08

  • 将所有这些内容放到之前的C:\Cert文件夹中:

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_09

  • 将该文件夹复制到CA02上的C:\Cert下

  • 登录CA02,打开Powershell,输入:

copy C:\Cert\*.cr* c:\pki\用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_10
certutil –installcert C:\Cert\CA02.contoso.com_contoso-CA02-CA.crt用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_11

start-service certsvc

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_12

copy c:\Windows\system32\certsrv\certenroll\*.cr* c:\pki\用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_13

此时CA01的任务已经完成,CA02的证书服务成功启动,CA01可以关机了。


配置CA02的AIA,CDP:

在CA02上以管理员身份打开Powershell,输入:

  • certutil -setreg CA\CRLPublicationURLs "1:C:\Windows\system32\CertSrv\CertEnroll\%3%8.crl\n2:http://www.contoso.com/pki/%3%8.crl"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_14

  • certutil -setreg CA\CACertPublicationURLs "2:http://www.contoso.com/pki/%1_%3%4.crt\n1:file://\\CA02.contoso.com\pki\%1_%3%4.crt"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_15

  • Certutil -setreg CA\CRLPeriodUnits 2

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_16

  • Certutil -setreg CA\CRLPeriod "Weeks"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_17

  • Certutil -setreg CA\CRLDeltaPeriodUnits 1

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_18

  • Certutil -setreg CA\CRLDeltaPeriod "Days"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_19

  • Certutil -setreg CA\CRLOverlapPeriodUnits 12

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_20

  • Certutil -setreg CA\CRLOverlapPeriod "Hours"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_21

  • Certutil -setreg CA\ValidityPeriodUnits 5

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_22

  • Certutil -setreg CA\ValidityPeriod "Years"

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_23

  • restart-service certsvc

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_Server 2012 R2_24

  • certutil -crl

用Windows Server 2012 R2 搭建二层证书服务结构 Part 4_证书服务_25

至此证书服务搭建完成,接下来我们配置自动颁布证书。