jdw*_*jdw 91 linux encryption openssl
在 Linux 中从命令行使用 OpenSSL,是否有某种方法可以检查密钥(公共或私有)以确定密钥大小?
Sha*_*den 113
openssl rsa -in private.key -text -noout
Run Code Online (Sandbox Code Playgroud)
输出的第一行将显示密钥大小。
例如:
Private-Key: (2048 bit)
Run Code Online (Sandbox Code Playgroud)
要查看证书的密钥大小:
$ openssl x509 -in public.pem -text -noout | grep "RSA Public Key"
RSA Public Key: (2048 bit)
Run Code Online (Sandbox Code Playgroud)
Adr*_* P. 11
第一个(2048)是密钥的位长:
$ ssh-keygen -lf /etc/ssh/rsa_key.pub
2048 91:1c:ae:17:16:...
Run Code Online (Sandbox Code Playgroud)