RSA公钥指纹

氧化

我正在尝试从如下创建的公钥中获取指纹:

openssl genrsa -out test.pem -aes128 -passout pass:testphrase 2048
openssl rsa -pubout -in test.pem -out test_public.pem -passin pass:testphrase

我正在将公钥上传到我的云提供商,以确认指纹70:d6:cb:9c:c7:95:ad:6f:49:84:4f:d1:fb:71:a8:53,我可以使用此命令从私钥中获取指纹

openssl rsa -in test.pem -pubout -outform DER | openssl md5 -c

(stdin)= 70:d6:cb:9c:c7:95:ad:6f:49:84:4f:d1:fb:71:a8:53

我试过了

openssl rsa -pubin test_public.pem -pubout -outform DER | openssl md5 -c

但这给了我d4:1d:8c:d9:8f:00:b2:04:e9:80:09:98:ec:f8:42:7e我想直接从公钥中获取指纹,我觉得我在这里遗漏了一些简单的东西。

氧化

好的,感谢@Topaco,我现在知道命令

openssl rsa -in test.pem -pubout -outform DER | openssl md5 -c

openssl rsa -pubin -in test_public.pem -outform DER | openssl md5 -c

给出相同的哈希值,我之前错过了-in标志test_public.pem

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章