Linux command
openssl-x509 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
View certificate details
openssl x509 -in [certificate.crt] -text -noout
Get certificate fingerprint
openssl x509 -in [certificate.crt] -fingerprint -sha256 -noout
Convert PEM to DER
openssl x509 -in [cert.pem] -outform DER -out [cert.der]
Check expiration date
openssl x509 -in [certificate.crt] -enddate -noout
Extract public key
openssl x509 -in [certificate.crt] -pubkey -noout
Create self-signed from key
openssl x509 -req -in [csr.pem] -signkey [key.pem] -out [cert.pem] -days [365]
说明
openssl x509 is a multi-purpose certificate utility. It can display information, convert formats, sign certificates, and modify certificate properties. One of the most commonly used OpenSSL commands for certificate management.
参数
- -in _file_
- Input certificate.
- -out _file_
- Output file.
- -text
- Print text form.
- -noout
- Don't output certificate.
- -fingerprint
- Print fingerprint.
- -subject, -issuer
- Print subject/issuer.
- -dates
- Print validity dates.
- -pubkey
- Output public key.
- -req
- Input is CSR.
- -signkey _file_
- Self-sign with key.
FAQ
What is the openssl-x509 command used for?
openssl x509 is a multi-purpose certificate utility. It can display information, convert formats, sign certificates, and modify certificate properties. One of the most commonly used OpenSSL commands for certificate management.
How do I run a basic openssl-x509 example?
Run `openssl x509 -in [certificate.crt] -text -noout` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -in _file_ do in openssl-x509?
Input certificate.