Linux command
openssl-rsa 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
View RSA key details
openssl rsa -in [private.key] -text -noout
Extract public key
openssl rsa -in [private.key] -pubout -out [public.key]
Remove passphrase
openssl rsa -in [encrypted.key] -out [decrypted.key]
Add passphrase
openssl rsa -in [private.key] -aes256 -out [encrypted.key]
Convert PEM to DER
openssl rsa -in [private.key] -outform DER -out [private.der]
Check key validity
openssl rsa -in [private.key] -check
说明
openssl rsa processes RSA keys. It can convert formats, extract public keys, add/remove encryption, and verify key integrity. For general key operations, consider using openssl pkey instead.
参数
- -in _file_
- Input file.
- -out _file_
- Output file.
- -pubout
- Output public key.
- -pubin
- Input is public key.
- -text
- Print components.
- -noout
- Don't output key.
- -check
- Check consistency.
- -aes256, -aes128
- Encrypt output.
- -inform, -outform
- Input/output format.
FAQ
What is the openssl-rsa command used for?
openssl rsa processes RSA keys. It can convert formats, extract public keys, add/remove encryption, and verify key integrity. For general key operations, consider using openssl pkey instead.
How do I run a basic openssl-rsa example?
Run `openssl rsa -in [private.key] -text -noout` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -in _file_ do in openssl-rsa?
Input file.