CA认证和证书

获取证书的两种方法:

  • 使用证书授权机构

生成签名请求(csr)

将csr发送给CA

从CA处接收签名

  • 自签名证书

    自己签发自己的公钥

自建CA颁发机构和自签名

实验用两台机器,一台做CA颁发证书,一台做客户端身申请证书

证书申请以及签署的步骤:

1、生成申请请求

2、CA核验

3、CA签署

4、获取证书

在实验开始之前,我们先来看一下openssl的配置文件:/etc/pki/tls/openssl.cnf

1.   [ ca ]
2.   default_ca   = CA_default              # The default ca section(默认的CA配置,是CA_default,下面第一个小节就是)
3.   ####################################################################
4.   [ CA_default ]
5.   dir          = /etc/pki/CA             # Where everythingis kept (dir变量)
6.   certs                 = $dir/certs              # Where the issued certs are kept(认证证书目录)
7.   crl_dir               = $dir/crl                # Where the issued crl are kept(注销证书目录)
8.   database     = $dir/index.txt # database indexfile.(数据库索引文件)
9.   new_certs_dir = $dir/newcerts           # default place for new certs.(新证书的默认位置)
10.  certificate  = $dir/cacert.pem         # The CA certificate(CA机构证书)
11.  serial                = $dir/serial             # The current serial number(当前序号,默认为空,可以指定从01开始)
12.  crlnumber    = $dir/crlnumber # the current crlnumber(下一个吊销证书序号)# must be commented out to leave a V1 CRL
13.  crl          = $dir/crl.pem            # The current CRL(下一个吊销证书)
14.  private_key  = $dir/private/cakey.pem# The private key(CA机构的私钥)
15.  RANDFILE     = $dir/private/.rand      # private randomnumber file(随机数文件)
16.  x509_extensions       = usr_cert                # The extentions toadd to the cert
17.  # Comment out the following two lines for the "traditional"
18.  # (and highly broken) format.
19.  name_opt      = ca_default              # Subject Nameoptions(被颁发者,订阅者选项)
20.  cert_opt      = ca_default              # Certificate fieldoptions(认证字段参数)
21.  # Extension copying option: use with caution.
22.  # copy_extensions = copy
23.  # Extensions to add to a CRL. Note: Netscape communicator chokes on V2CRLs
24.  # so this is commented out by default to leave a V1 CRL.
25.  # crlnumber must also be commented out to leave a V1 CRL.
26.  # crl_extensions      = crl_ext
27.  default_days = 365                     # how long to certify for (默认的有效期天数是365)
28.  default_crl_days=30                    # how long before next CRL
29.  default_md   = sha256         # use SHA-256 by default
30.  preserve     = no                      # keep passed DN ordering
31.  # A few difference way of specifying how similar the request should look
32.  # For type CA, the listed attributes must be the same, and the optional
33.  # and supplied fields are just that :-)
34.  policy                = policy_match  # 是否匹配规则
35.  # For the CA policy
36.  [ policy_match ]
37.  countryName           = match   # 国家名是否匹配,match为匹配
38.  stateOrProvinceName   = match # 州或省名是否需要匹配
39.  organizationName      = match # 组织名是否需要匹配
40.  organizationalUnitName         = optional # 组织的部门名字是否需要匹配
41.  commonName            = supplied # 注释
42.  emailAddress          = optional # 邮箱地址
43.  # For the ‘anything‘ policy
44.  # At this point in time, you must list all acceptable ‘object‘
45.  # types.
46.  [ policy_anything]
47.  countryName           = optional
48.  stateOrProvinceName   = optional
49.  localityName          = optional
50.  organizationName      = optional
51.  organizationalUnitName         = optional
52.  commonName            = supplied
53.  emailAddress          = optional
1.   dir         = /etc/pki/CA        # Where everything is kept
2.   certs        = $dir/certs        # Where the issued certs are kept
3.   database      = $dir/index.txt        # database index file.
4.   new_certs_dir   = $dir/newcerts         # default place for new certs.
5.   certificate     = $dir/cacert.pem       # The CA certificate
6.   serial       = $dir/serial           # The current serial number
7.   private_key     = $dir/private/cakey.pem# The private key

 1、创建所需要的文件

touch /etc/pki/CA/index.txt 生成证书索引数据库文件

echo 01 > /etc/pki/CA/serial 指定第一个颁发证书的序列号

2、    CA自签证书

生成私钥

(umask 066; openssl  genrsa-out    /etc/pki/CA/private/cakey.pem   -des 2048)

生成自签名证书

openssl req -new -x509 -key /etc/pki/CA/private/cakey.pem -days 7300 -out  /etc/pki/CA/cacert.pem

时间: 2024-08-01 19:07:35

CA认证和证书的相关文章

CA认证和颁发吊销证书

摘要:涉及到网络安全这一块,想必大家都听过CA吧.像百度.淘宝.京东等这些知名网站,每年都要花费一笔money来买CA证书.但其实简单的企业内的CA认证,我们自己就可以实现,今天小编我就讲解一下怎么在企业局部实现CA认证. 一.CA介绍 1.电子商务认证授权机构(CA, Certificate Authority),也称为电子商务认证中心,是负责发放和管理数字证书的权威机构,并作为电子商务交易中受信任的第三方,承担公钥体系中钥的合法性检验的责任. 2.PKI: Public Key Infras

数字签名,数字证书,CA认证等概念理解

本文将介绍数字签名,数字证书以及CA相关知识. 加密相关知识可见我的上一篇博文:http://watchmen.blog.51cto.com/6091957/1923426 本文参考文献引用链接: 1.https://www.zhihu.com/question/25912483 2.https://blog.jorisvisscher.com/2015/07/22/create-a-simple-https-server-with-openssl-s_server/ 3.https://zh.

探究公钥、私钥、对称加密、非对称加密、hash加密、数字签名、数字证书、CA认证、https它们究竟是什么,它们分别解决了通信过程的哪些问题。

一.准备 1. 角色:小白.美美.小黑. 2. 剧情:小白和美美在谈恋爱:小黑对美美求而不得.心生怨念,所以从中作梗. 3. 需求:小白要与美美需通过网络进行通信,联络感情,所以必须保证通信的安全性. 二.由通信过程中可能出现的问题来引出公钥.私钥.对称加密.非对称加密.hash加密.数字签名.数字证书.CA认证.https的相关知识 1. 场景1: 小白和美美在 http 协议下进行通信. 1.1 能否完成通信:能. 1.2 还可能出现其他问题:容易受到网络中间人攻击:在http协议下进行通信

CA认证授权服务器部署

数字证书授权中心:CA →Certificate Authority - 被通信双方信任的.独立的第三方机构 - 负责证书颁发.验证.撤销等管理 国内常见的CA机构 - 中国金融认证中心(CFCA) - 中国电信安全认证中心(CTCA) - 北京数字证书中心(BJCA) PKI公钥基础设施 - PKI是一套标准的密钥管理平台; - 通过公钥加密.数字证书技术确保信息安全; PKI体系基本组成 - 权威认证机构(CA) - 数字证书库.密钥备份及恢复系统 - 证书作废系统.应用接口 web网站把公

CA与数字证书的自结

1.CA CA(Certificate Authority)是数字证书认证中心的简称,是指发放数字证书.管理数字证书.废除数字证书的权威机构. 2.数字证书 假设向CA申请数字证书的单位为A,则他申请的数字证书中含有的内容为: a)A的公钥数据 b)相应私钥拥有者(也就是A)的身份信息 c)CA机构对数字证书进行了数字签名 d)包含了CA的名称,以便于依赖方找到CA的公钥.验证证书上的数字签名 Remarks:在第c)条中,当某个用户得到某个单位的数字证书时,要该数字证书进行认证,就是看看是不是

centos 6.5 httpd 自建CA 认证 实现 https 服务

httpd 自建CA 认证 实现 https 服务 需要的软件: httpd mod_ssl openssl [[email protected] CA]# httpd -v #httpd版本 Server version: Apache/2.2.15 (Unix) Server built:   Jul 23 2014 14:15:00 [[email protected] CA]# uname -r #内核版本 2.6.32-431.el6.i686 [[email protected] C

Linux中加密和解密技术及CA认证

网络安全通信: 为了不让自己的隐私,信息等随随便便就能让获取,所以需要对数据进行加密处理,保证数据在传输的过程中不被别人获取,网络通信安全需要达到以下三个目的: 1.数据的保密性 2.数据的完整性 3.来源的合法性 解决网络安全通信的方案: SSL:Secure Sockets Layer  安全的套接层,位于应用层和传输层之间,为数据通信提供安全支持,可在服务端和客户端同时支持一种加密算法.目前版本SSLV2,SSLV3(常用). HTTP调用SSL协议就变成HTTPS,多了层加密解密功能.

OpenSSL:实现创建私有CA、签署证书请求详解

一.OpenSSL:CA默认配置信息 1.证书签发机构CA:公共信任CA.私有CA 建立私有CA方式如下: 小范围测试使用openssl. 大范围维护大量证书企业使用OpenCA(对openssl进行了二次封装,更加方便使用) 2.openssl 配置文件:/etc/pki/tls/openssl.cnf [[email protected] tmp]# cat  /etc/pki/tls/openssl.cnf 该配置文件中以 "[配置段]",的形式配置相关信息 ==========

Openssl 加密,解密,CA认证

今天我们来说一说openssl,那到底什么是openssl呢? OpenSSL是一个安全工具集,同时也提供了开源程序库.它支持ssl(Secure Sockets Layer, v2/v3),TLS(Transport Layer Secure, v1).这套工具集的应用范围非常之广 OpenSSL由三部分组成:libencrypto库,libssl库,openssl多用途命令行工具 接着我们说一下加密算法和协议: 1,对称加密:加密和解密使用同一个密钥: 特性: