更新时间:2022-03-25 23:13:07
openssl genrsa -out mykey.pem 1024
实际上将产生一个公钥-私钥对.该对存储在生成的mykey.pem
文件中.
will actually produce a public - private key pair. The pair is stored in the generated mykey.pem
file.
openssl rsa -in mykey.pem -pubout > mykey.pub
将提取公共密钥并打印出来. 此处是指向页面的链接,该链接对此进行了更好的描述.
will extract the public key and print that out. Here is a link to a page that describes this better.
在此处中查看示例部分.要仅输出私钥的公共部分:
Check the examples section here. To just output the public part of a private key:
openssl rsa -in key.pem -pubout -out pubkey.pem
要获取用于SSH的可用公共密钥,请使用 ssh-keygen :
To get a usable public key for SSH purposes, use ssh-keygen:
ssh-keygen -y -f key.pem > key.pub