资源描述
CA认证的流程和原理
CA认证的流程和原理
编辑整理:
尊敬的读者朋友们:
这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望(CA认证的流程和原理)的内容能够给您的工作和学习带来便利。同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。
本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快 业绩进步,以下为CA认证的流程和原理的全部内容。
CA认证的流程和原理
AD CS(活动目录证书服务)是微软的公钥基础结构(PKI)的实现.PKI处理颁发并管理用于加密和身份验证的的数字证书的组件及过程. AD CS颁发的数字证书可以用于加密文件系统、电子邮件加密、安全套接字层SSL和身份验证。 安装了AD CS的服务器成为证书颁发机构CA.
1. 数字证书
数字证书是一种电子凭据用于验证个人,组织和计算机.证书颁发机构颁发和认证证书。数字证书提供了一种方法来验证证书持有者的身份。证书使用加密技术来解决两个实体之间的问题.
数字证书都用于非对称加密,它需要两个密钥,第一个密钥是私钥,它由被颁发了数字证书的用户或计算机安全地存储,第二个密钥是分发到其它用户和计算机的公钥。由一个密钥加密的数据只能由另一个密钥解密。这种关系确保对加密数据的保护。
一张证书包含下面的数据:
1。 公用密钥证书主题的公钥和私钥对。这样可以使用证书来验证拥有私钥的个人或计算机的标识。例如,一台web服务器的数字证书包括web服务器的主机名和IP地址
2。 有关申请证书的使用者的信息
3。 有关CA颁发证书的详细信息,包括证书有效性的信息,包括如何使用证书以及它的有效期。例如,可能限制一个证书只用于加密文件系统,证书只在特定时间期有效,通常是两年或更短,证书过期之后就不能再使用它了。
Enhanced Key Usage是证书的一个可选的扩展属性,这个属性包含一个目标标识符(OID),用于应用程序或者服务.每个OID是一个独特的数字序列。
Key Usage: 证书允许主体执行特定任务。为了帮助控制证书在其预定的目的以外的使用,限制自动放置在证书。密钥用法(Key Usage)就是一个限制方法来决定一个证书可以被用来干什么。它允许管理员颁发证书,它只能用于特定任务或用于更广泛的功能。如果没有指定密钥用法,证书可以用于任何目的。
对于签名, key usage可以有下列一个或者多个用途:
1. 数字签名
2。 签名一种起源的证据
3。 证书签名
4. CRL签名
2. CA证书颁发机构
CA是向用户和计算机颁发数字证书的PKI组件,当组织实现数字证书时,他们必须考虑是使用AD CS还是一个外部CA来实现。内部CA的主要优点是成本,对于颁发的每个证书都没有额外成本。而如果使用外部CA(三方CA),每个颁发的证书都有一定费用。
CA的主要作用如下:
1. 验证证书请求者的身份:当一张证书颁发给一个用户、计算机或者服务的时候,CA会验证请求者身份来确保证书只办法给正确的用户或机器
2. 将证书办法给用户和计算机
3. 管理证书吊销情况:CA会定期发布CRL,CRL包含证书的序列号以及被吊销的情况。
3. 请求和颁发证书的过程
用户、计算机和服务请求和接收来自CA的证书.请求和接收证书的过程被称为注册。通常,用户或计算机启动注册通过提供独特的信息,如电子邮件地址或通用名称,和一个新生成的公钥。在产生证书之前CA使用此信息来验证用户的身份。
1. 生成密钥对。 申请人生成一个公钥和私钥对,或被组织的权威指定一个密钥对。申请人将密钥对存放在本地存储的磁盘上或如智能卡的硬件设备
2. 申请人提供请求的证书模板所需的证书信息请求,并将它发送到CA。证书请求包括公共和私人密钥对的公钥生成请求的计算机
3. 证书管理器检查证书请求验证信息。基于这些信息,证书管理器颁发证书或拒绝证书请求
4. CA创建并颁发证书给请求者。由CA签名证书,以防止修改,包括请求者的身份信息和提交的公共密钥作为颁发的证书的属性。
4. 证书链
链建立是建立信任链的过程或者证书路径,从最终证书以及安全实体信任的根证书。
证书链的建立将会通过检查从最终证书到根CA的每个证书路径。会从中级证书颁发机构存储区,受信任的根证书颁发机构存储区,或从一个证书的AIA属性中指定的URL中检索证书。如果加密应用程序接口发现一个路径中的证书有问题,或者如果它找不到证书,证书路径是会作为一个不受信任的证书路径丢弃。
证书链引擎生成所有可能的证书链.然后整个的证书链就生成了并按照链的质量排序。对于给定的最终的质量最好的证书链作为默认的链返回给调用应用程序。每个链都是通过结合证书存储的证书和发布的URL位置的证书。链中的每个证书分配一个状态代码。状态代码指示证书是否符合下面的条件:
1。 签名是否有效
2。 时间是否合法
3. 证书是否过期
4. 证书是否已经被吊销
5. 时间嵌套
6. 证书上的其他限制
每个状态代码都有一个分配给它的优先级。例如,过期的证书具有更高的优先级比吊销的证书.这是因为过期的证书不检查吊销状态.证书链中的所有证书都会被检查是否吊销.不管是什么过程来检查证书的合法性,只要证书链中的状态检查失败,这个证书链就会被拒绝。
对链中的每个证书,证书链引擎必须选择一个颁发CA的证书。这一过程被称为验证路径,重复验证直到达到一个自签名证书(通常,这是根CA证书)。加密应用程序接口对待根证书作为绝对信任的信任。
5. Certificate Service组件的工作原理
CA服务包括如下组件以及功能,请参考:
Client Module: 负责提交证书申请
Certificate Services Engine: 负责处理证书申请请求,负责创建和颁发证书给有效的申请者
Policy module: 负责验证请求者是否有权获得证书
CryptoAPI and cryptographic service providers:负责创建私钥并分发给申请者的受保护的证书存储
exit module:负责分发证书给有效的客户端,在网页、公共文件夹、AD中发布证书,负责向AD中定期发布CRLs
CryptoAPI:负责管理所有加密操作的私钥
certificates database:负责存储所有的证书交易以及审计
CA服务所使用的协议有DCOM和LDAP
DCOM:用来进行证书注册
LDAP:用来进行域AD之间的交互
证书创建的过程如下:
· This process applies to most common PKCS #10 requests or Certificate Management protocol using CMS requests.
1. When a user initiates a certificate request, Enrollment Control (Xenroll。dll) uses a cryptographic service provider (CSP) on the client’s computer to generate a public key and private key pair for the user。 当用户初始化证书请求的时候,CSP会创建出一个公钥和私钥对。
2. After a key pair has been generated, Xenroll builds a certificate request based on a certificate template。 密钥对创建之后,会基于模板创建出一个证书请求
3. The user’s public key is sent with the user’s identifying information to the Certificate Services engine。 用户的公钥以及身份信息会被发送给证书服务引擎
4. Meanwhile, a copy of the request is placed in the request folder for the requester. In the case of a user, this folder is: 同时,在本地保存一份请求
C:\Documents and Settings\username\Application Data\Microsoft\SystemCertificates\Request\
5. The CA authenticates the user. CA需要对用户进行验证
6. The Certificate Services engine passes the request to the policy module, which might perform an additional access check by querying Active Directory or another reliable source such as IIS。 证书服务引擎将请求发送给policy module, policy module负责到AD中请求进行检查.
7. The policy module also checks the registry for a list of certificate templates for the CA。 The policy module checks the list for version numbers to verify that it has the most recent versions of all certificate templates. If the request references a more recent version of the certificate template than is currently available, the request fails. Policy module负责检查证书模板中的注册表信息。
8. If the access check is successful, the Certificate Services engine creates a new row in the Request and Certificates table of the certificates database. A request ID is entered into the database to help track the request。 访问检查成功之后,请求号被存储在数据库中
9. Additional attributes of the certificate request, such as the extensions associated with the request, are entered into the appropriate fields in the database.证书的其它相关属性被写入CA的数据库中
10. The Certificate Services engine validates the digital signature used to sign the certificate request。 This validation process involves comparing all the certificates in the chain leading up to the root CA to a reliable source, such as Active Directory or IIS。 This validation process also involves confirming that none of the certificates in the chain has been revoked. 验证数字证书,检查证书链
11. The policy module applies a certificate template to fill out the data associated with the request. This process adds information such as usage restrictions and validity periods, as well as subject name format, to the data in the original request. Some of this data is fixed and therefore copied directly from the template, some comes from the certificate request, and some is constructed on a per user basis (concatenating the friendly name of the user into common name format, for example).
Note
o When a certificate is being renewed, data that is not being modified is simply reused。
12. If a certificate template has been set to pending, an administrator must verify related information in the request — such as the identity of the requester — which is not controlled by the policy module. 检查证书模板
13. The policy module returns the request to the Certificate Services engine, noting whether the request should be issued, should be denied, or is pending。 检查该证书是否应该被颁发
14. If the request has been approved, the Certificate Services engine constructs the certificate with the appropriate subject, validity period, and extensions. 如果请求被批准,则将相关的信息放置在证书中生成一张证书
15. The Certificate Services engine encodes, signs, and validates the certificate from information in the database to verify that the certificate is valid for the entire certificate chain and all defined purposes, and performs another revocation check before it issues the certificate.
16. The issued certificate is sent to the exit module, which saves the certificate to the certificates database and, depending on the template configuration, publishes it to the directory service.
Note
o If this is a local forest, the certificate is published to the user object。 If this is a forest trust, the certificate is published to the contact object.
17. The exit module constructs and signs a response, which is returned to Xenroll。dll on the client. This response can include:
o A CMS response。
o A certificate BLOB。
o A message indicating whether the certificate request has been approved, has been denied, or is pending.
o An error message。
o Request ID。
Xenroll places the certificate in the following folder:
C:\Documents and Settings\username\Application Data\Microsoft\SystemCertificates\My\Certificates
详细的过程请参考官方文档:
How Certificate Services Works
https://technet。microsoft。com/en-us/library/cc783853(v=ws.10)。aspx
Windows Server 2012R2 CA的部署过程
在域环境中,企业Ca的安装还是比较简单的,基本不需要手动配置,在Windows server 2012上略有不同,需要先安装,在配置。
首先打开服务器管理器,选择“添加角色和功能”,如图。
在选择角色服务界面,勾选“证书颁发机构“.
安装向导完成后,还需要后续进入Ca的配置向导,这是和Windows 2008之前的Ca安装不同的地方(在Windows 2008之前,Ca的安装和配置均在一个向导里),如图。
设置类型保持默认为企业Ca,如图。
CA类型保持默认为根Ca,如图。
在指定私钥类型界面,保持默认,如图。
在指定加密选项界面,保持默认,如图.
在指定Ca名称界面,保持默认,如图。
在指定Ca的有效期界面,保持默认,如图。
在指定Ca数据库位置界面,保持默认,如图。
在摘要界面,确认设置没有问题后,选择“配置”,如图。
配置完成后,如图所示。
另外Ca安装成功之后,为了简化管理,我们还可以配置一下Ca根证书的自动颁发。
打开组策略管理工具,右击编辑默认的域策略,如图。
展开到自动证书申请设置,如图。
进入自动证书申请设置向导,如图.
选择证书默认为计算机,如图。
完成自动证书申请设置,如图.
参考链接:
Active Directory Certificate Services (AD CS) Overview
http://social。technet。
Active Directory Certificate Services
http://technet。
How Certificate Services Works
https://technet.microsoft。com/en—us/library/cc783853(v=ws.10).aspx
How Certificates Work
http://technet.microsoft。com/en—us/library/cc776447(WS。10,printer).aspx
https://technet。
展开阅读全文