RSA加密堆成加密算法秘钥进行安全会话的全部过程
怎么确认是服务器的
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495589074.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495594749.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495601298.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495624845.png)
黑客没有私钥不能冒充
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495644040.png)
enter description here
服务器用私钥加密信息,无法保密,因为公钥是公开的这里客户端通过RSA发送服务器对称加密算法和秘钥给服务器
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495674353.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495706586.png)
enter description here
如果刚开始的公钥私钥都是假的问题、下就被黑了
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586495893366.png)
enter description here
解决方案、证书机构、另外的RSA加密机构证明公钥是属于该服务器的,这种证书机构也就是网上比较权威的要申请掏钱
证书上的内容:
自建ca只能在公司局域网内部使用不被外部认可
用于用户访问的ssl证书的使用、类似签名机制
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499560573.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499591049.png)
openssl是一个密码库软件包
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499787315.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499790075.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499792742.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499796290.png)
数字签名证书验证过程
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586499909533.png)
enter description here
https的通信过程
https的通信过程 服务端需要认证的通信过程 客户端发送请求到服务器端 服务器端返回证书和公开密钥,公开密钥作为证书的一部分而存在 客户端验证证书和公开密钥的有效性,如果有效,则生成共享密钥并使用公开密钥加密发送到服务器端 服务器端使用私有密钥解密数据,并使用收到的共享密钥加密数据,发送到客户端 客户端使用共享密钥解密数据 SSL加密建立………自建证书用途
要支持HTTPS这边就涉及获取CA证书的问题,正式开发当然需要去购买,如果像笔者这样只是开发内测,可以用自己生成的自签名证书。生成数字证书的工具有openssl、keytool等。