openssl 查看證書細節

  1. 打印證書的過期時間
openssl x509 -in signed.crt -noout -dates
  1. 打印出證書的內容:
openssl x509 -in cert.pem -noout -text
  1. 打印出證書的系列號
openssl x509 -in cert.pem -noout -serial
  1. 打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject
  1. 以 RFC2253 規定的格式打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
  1. 在支持 UTF8 的終端一行過打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject -nameopt oneline -nameopt -escmsb
  1. 打印出證書的 MD5 特徵參數
openssl x509 -in cert.pem -noout -fingerprint
  1. 打印出證書的 SHA 特徵參數
openssl x509 -sha1 -in cert.pem -noout -fingerprint
  1. 把 PEM 格式的證書轉化成 DER 格式
openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
  1. 把一個證書轉化成 CSR
openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem
  1. 給一個 CSR 進行處理,頒發字簽名證書,增加 CA 擴展項
openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca -signkey key.pem -out cacert.pem
  1. 給一個 CSR 簽名,增加用戶證書擴展項
openssl x509 -req -in req.pem -extfile openssl.cnf -extensions v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial
  1. 查看 csr 文件細節:
openssl req -in my.csr -noout -text
本文由 Readfog 進行 AMP 轉碼,版權歸原作者所有。
來源https://www.cnblogs.com/shenlinken/p/9968274.html