我正在尝试从如下创建的公钥中获取指纹:
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
。
我想直接从公钥中获取指纹,我觉得这里缺少一些简单的东西。
答案 0 :(得分:0)
好的,感谢@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
标志。