xutil.dev
ログイン

自己署名証明書コマンド生成

開発・テスト用の自己署名SSL証明書を作成するopensslコマンドを生成。SAN(サブジェクト代替名)・ワイルドカード・有効期間を指定でき、ローカル開発環境のHTTPS化に最適です

関連カテゴリ:セキュリティ
証明書フィールド
RSAEC
2048 bit3072 bit4096 bit
30d90d365d730d
生成されたコマンド
One-liner

Generate private key and self-signed certificate in one command

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
Step 1: Generate RSA Private Key

Generate a 2048-bit RSA private key

openssl genrsa -out key.pem 2048
Step 2: Generate CSR

Create a Certificate Signing Request

openssl req -new -key key.pem -out csr.pem -subj "/CN=localhost"
Step 3: Self-Sign

Sign the CSR with the private key

openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem -days 365
Verify Certificate

View the generated certificate details

openssl x509 -in cert.pem -text -noout
Verify Key

Check the private key

openssl pkey -in key.pem -check -noout