Answers:
openssl rsa -in private.key -text -noout
输出的第一行将显示密钥大小。
例如:
Private-Key: (2048 bit)
要从证书查看密钥大小:
$ openssl x509 -in public.pem -text -noout | grep "RSA Public Key"
RSA Public Key: (2048 bit)
| grep "Public-Key"
第一个(2048)是密钥的位长:
$ ssh-keygen -lf /etc/ssh/rsa_key.pub
2048 91:1c:ae:17:16:...