IDC知識(shí)庫
IDC領(lǐng)域?qū)I(yè)知識(shí)百科平臺(tái)

利用openssl命令查看證書文件內(nèi)容

openssl是一個(gè)開源軟件庫和命令行實(shí)用程序,用于開發(fā)安全套接字層(SSL)和傳輸層安全(TLS)協(xié)議的安全性。在openssl中,可以使用命令行實(shí)用程序openssl來查看SSL證書的有效期。

打印證書的過期時(shí)間
openssl x509 -in signed.crt -noout -dates
打印出證書的內(nèi)容:
openssl x509 -in cert.pem -noout -text
打印出證書的系列號(hào)
openssl x509 -in cert.pem -noout -serial
打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject
以RFC2253規(guī)定的格式打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
在支持UTF8的終端一行過打印出證書的擁有者名字
openssl x509 -in cert.pem -noout -subject -nameopt oneline -nameopt -escmsb
打印出證書的MD5特征參數(shù)
openssl x509 -in cert.pem -noout -fingerprint
打印出證書的SHA特征參數(shù)
openssl x509 -sha1 -in cert.pem -noout -fingerprint
把PEM格式的證書轉(zhuǎn)化成DER格式
openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
把一個(gè)證書轉(zhuǎn)化成CSR
openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem
給一個(gè)CSR進(jìn)行處理,頒發(fā)字簽名證書,增加CA擴(kuò)展項(xiàng)
openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca -signkey key.pem -out cacert.pem
給一個(gè)CSR簽名,增加用戶證書擴(kuò)展項(xiàng)
openssl x509 -req -in req.pem -extfile openssl.cnf -extensions v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial
查看csr文件細(xì)節(jié):
openssl req -in my.csr -noout -text

贊(3)
分享到: 更多 (0)

中國專業(yè)的網(wǎng)站域名及網(wǎng)站空間提供商

買域名買空間