使用RSA私钥生成公钥? [英] Use RSA private key to generate public key?
问题描述
我不太了解这一点:
根据: http://www.madboa.com/geek/openssl/#key-rsa ,您可以从私钥中生成公钥.
according to: http://www.madboa.com/geek/openssl/#key-rsa , You can generate a public key from a private key.
openssl genrsa -out mykey.pem 1024
openssl rsa -in mykey.pem -pubout > mykey.pub
我最初的想法是,它们是成对在一起产生的. RSA私钥是否包含总和?还是公钥?
My initial thinking was that they are generated in a pair together. Does RSA private key contain the sum? or the public key?
推荐答案
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
这篇关于使用RSA私钥生成公钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!