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)