CA认证的具体实验步骤

博文目录

CA认证的配置文件是/etc/pki/tls/opensl.cnf

服务器的操作

1.进入/etc/pki/CA下

创建 index.txt,serial,crlnumber这三个文件
并为为创建记录证书文件和吊销证书文件给予编号
[[email protected] ~]# cd /etc/pki/CA
[[email protected] CA]# touch index.txt
[[email protected] CA]# touch serial
[[email protected] CA]# touch crlnumber
[[email protected] CA]# echo 01 > serial 
[[email protected] CA]# echo 01 > crlnumber

2.建立私钥文件

[[email protected] CA]# (umask 077 ; openssl genrsa -out /etc/pki/CA/private/cakey.pem 4096 )
Generating RSA private key, 4096 bit long modulus
..................................................++
.....................................................................................................................................................................................++
e is 65537 (0x10001)
#()代表建立一个子shell,umask 077 改变子shell的权限
#openssl genrsa -out 输入一个密钥文件 长度为4096
[[email protected] CA]# tree                               #查看CA目录下的文件
.
├── cacert.pem
├── certs
├── crl
├── crlnumber
├── index.txt
├── newcerts
├── private
│   └── cakey.pem
└── serial
4 directories, 5 files

3.给自己颁发CA认证

[[email protected] CA]# openssl req -new -x509 -key /etc/pki/CA/private/cakey.pem  -out /etc/pki/CA/cacert.pem -days 36500
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN                                                                       # 国家
State or Province Name (full name) []:beijing                                                          # 省/州
Locality Name (eg, city) [Default City]:beijing                                                          # 城市
Organization Name (eg, company) [Default Company Ltd]:bta                             # 公司
Organizational Unit Name (eg, section) []:yunwei                                                   # 部门
Common Name (eg, your name or your server‘s hostname) []:bta.com             # 所需要认证的名称
Email Address []:[email protected]                                                                                  # Email

客户端

客户端需要在/etc/pki/tls/下操作

1.进入 /etc/pki/tls建立私钥文件

[[email protected] ~]$cd /etc/pki/tls/
[[email protected] tls]$(umask 077; openssl genrsa -out /etc/pki/tls/private/TianRandai.key 2048)
Generating RSA private key, 2048 bit long modulus
....+++
..+++
e is 65537 (0x10001
[[email protected] tls]$tree private/    #查看TianRandai.key是否创建成功
private/
└── TianRandai.key
0 directories, 1 file

2.导出证书

[email protected] tls]$openssl req -new -key private/TianRandai.key -out TianRandai.csr 
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN  
State or Province Name (full name) []:beijing
Locality Name (eg, city) [Default City]:beijing
Organization Name (eg, company) [Default Company Ltd]:bta
Organizational Unit Name (eg, section) []:yunwei
Common Name (eg, your name or your server‘s hostname) []:www.bta.com
Email Address []:[email protected]
Please enter the following ‘extra‘ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
#这里的内容需要和服务端match的地方填写相同的信息

3.将证书复制到服务端

[[email protected] tls]$scp TianRandai.csr 172.18.17.21:/etc/pki/CA
[email protected]‘s password: 
TianRandai.csr                                                                                                                                            100% 1041     1.0KB/s   00:00

服务端

1.查看一下客户端文件

[[email protected] CA]# tree
.
├── cacert.pem
├── certs
├── crl
├── crlnumber
├── index.txt
├── newcerts
├── private
│   └── cakey.pem
├── serial
└── TianRandai.csr

#客户端文件已经拷贝过来了

4 directories, 6 files

2.认证客户端文件生成CA证书

[[email protected] CA]# openssl ca -in TianRandai.csr -out TianRandai.crt -days 365    
#-days 给予证书的期限,默认以天为单位
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Feb 21 01:57:04 2017 GMT
            Not After : Feb 21 01:57:04 2018 GMT
        Subject:
            countryName       = CN
            stateOrProvinceName   = beijing
            organizationName     = bta
            organizationalUnitName  = yunwei
            commonName        = www.bta.com
            emailAddress              = [email protected]
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                2C:2E:03:82:0A:2C:95:11:7E:0F:71:DC:41:B8:B6:F8:F3:32:3B:1F
            X509v3 Authority Key Identifier: 
                keyid:98:9B:95:79:0B:0A:25:93:17:06:D1:02:92:1A:EF:A0:6F:6B:95:D8
Certificate is to be certified until Feb 21 01:57:04 2018 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

3.拷贝到windows上来开一看,木有问题

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

CA认证的具体实验步骤的相关文章

CA认证授权服务器部署

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

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] centos 6.5 httpd 自建CA 认证 实现 https 服务

httpd 自建CA 认证 实现 https 服务 需要的软件: httpd mod_ssl openssl 本文将CA证书服务器和 httpd服务器放到一台物理机器上实现的, 可以作为学习的参考. 本文测试主机IP192.168.1.100/24 [[email protected] CA]# httpd -v #httpd版本 Server version: Apache/2.2.15 (Unix) Server built: Jul 23 2014 14:15:00 [[email pro

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.

CA认证以及https的实现

(1).CA认证 CA全称Certificate Authority,通常翻译成认证权威或者认证中心,主要用途是为用户发放数字证书.认证中心(CA)的功能:证书发放.证书更新.证书撤销和证书验证.CA证书的作用:身份认证,实现数据的不可否认性. CSR全称Cerificate Signing Request,中文名证书请求文件,是证书申请者在申请数字证书时由CSP(加密服务提供者)在生成私钥的同时也生成证书请求文件,证书申请者只要把CSR文件提交给证书颁发机构后,证书颁发机构使用其根证书的私钥签

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

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

使用加密解密技术和CA认证解决网络传输中的安全隐患

服务端:xuegod63.cn   IP:192.168.1.63 客户端:xuegod64.cn   IP:192.168.1.64   网络安全: 网络传输中的安全隐患-.   中间人攻击 全隐患:        解决方法 1.窃听-- >  加密 2.篡改 ->  哈西算法:MD5,sha1 (检查数据完整性) 3.伪装(钩鱼网站,伪装WIFI)  ->  身份认证(用户名/密码.数字证书) 4.网络中断 (内网冒冲网关,DDOS )  –>绑定静态arp地址: 加大服务器和

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

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