Replies: 3 comments
-
密钥生成和导入创建密钥对
传播公钥
Note,
把所有的public key都导出了! 二进制格式公钥↑ 交换key
列出所有公钥
列出所有私钥
|
Beta Was this translation helpful? Give feedback.
-
密钥使用对方的公钥加密,对方的私钥解密
生成 hello.pgp 发给好友(carlos)用自己的私钥解密
同样用carlos加密,haochenwei解密 自己的私钥加签,对方验签签名和文件一体式的用haochenwei的机器的私钥加签:
把haochenwei的hello.sig文件发送给carlos即可 验签:
签名和文件分离的
会生成hello.sig ,重命名为 dhello.sig 把 hello + dhello.sig 发给carlos
|
Beta Was this translation helpful? Give feedback.
-
X509转gpghttps://www.pengdows.com/2020/06/27/convert-a-x-509-pki-certificate-to-gpg/
基于(自己生成 步骤 1:生成 Root CA 的私钥和自签名根证书首先,生成一个 Root CA 的私钥和自签名的根证书: # 生成 rootca 私钥 (pem 格式)
openssl genrsa -out rootca.key 2048
# 生成自签名的 rootca.crt (x509 格式)
openssl req -x509 -new -nodes -key rootca.key -sha256 -days 3650 -out rootca.crt -subj "/C=CN/ST=Beijing/L=Beijing/O=MyOrg/OU=IT/CN=RootCA"此时,您应该已经有了:
步骤 2:生成 Xiaoming 的私钥和证书签署请求(CSR)接下来,生成 Xiaoming 的私钥和证书签署请求(CSR): # 生成 xiaoming 私钥 (pem 格式)
openssl genrsa -out xiaoming.key 2048
# 生成 xiaoming 的证书签署请求 (csr)
openssl req -new -key xiaoming.key -out xiaoming.csr -subj "/C=CN/ST=Beijing/L=Beijing/O=MyOrg/OU=IT/CN=Xiaoming"此时,应该已经有了:
步骤 3:使用 Root CA 签署 Xiaoming 的证书使用 Root CA 的密钥和证书签署 Xiaoming 的证书: # 用 Root CA 签署 xiaoming 的证书
openssl x509 -req -in xiaoming.csr -CA rootca.crt -CAkey rootca.key -CAcreateserial -out xiaoming.crt -days 365 -sha256此时,您应该已经有了:
步骤 4:将 Xiaoming 的私钥和证书打包为 PKCS#12 文件将 # 将 xiaoming 的私钥和证书转换为 PKCS#12 格式
openssl pkcs12 -export -out gpg-key.p12 -inkey xiaoming.key -in xiaoming.crt -certfile rootca.crt -name "Xiaoming"此时,应该有一个 PKCS#12 文件 步骤 5:使用
|
Beta Was this translation helpful? Give feedback.







Uh oh!
There was an error while loading. Please reload this page.
-
参考: https://gist.github.com/jhjguxin/6037564
Beta Was this translation helpful? Give feedback.
All reactions