ユーザ用ツール

サイト用ツール


linux:openssl

OpenSSLによる証明書管理

鍵の作成

openssl genrsa -out <keyname> <key_length>

CSRの作成

openssl req -new -key <keyname> -out <csr_file>

証明書の内容の確認

PEM形式の場合

openssl x509 -text -noout -in <crt_file>

DER形式の場合

openssl x509 -text -noout -inform der -in <crt_file>

証明書の有効期限を確認

openssl x509 -in <crt_file> -noout -dates

秘密鍵ファイル内容の確認

openssl rsa -text -noout -in <key_file>

CSRファイル内容の確認

openssl req -text -noout -in <csr_file>

自己証明書作成例

openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
linux/openssl.txt · 最終更新: 2024/04/02 11:42 by mikoto