以下に示すように、openssl コマンドを使用して、Linux で CA 署名付きエンド エンティティ証明書を作成しようとしています。
# openssl genrsa -des3 -out clientkey.pem 2048
# openssl req -new -key clientkey.pem -out clientcert.csr
# cp clientkey.pem clientkey.pem.org
# openssl rsa -in clientkey.pem.org -out clientkey.pem
# openssl x509 -req -days 1 -in clientcert.csr -out clientcert.pem -CA cacert.pem -CAkey cakey.pem -CAcreateserial
有効期限を日数ではなく時間単位で指定することはできますか? いくつかのテストのために、たとえば1時間の有効期限で証明書を生成する必要があります。
Openssl コマンドは、startdate と enddate を指定するいくつかのオプションをサポートしているようですが、その使用方法がわかりません。( enddate が日付と時刻の指定をサポートしている可能性があると想定しています)。
#openssl x509 -req -startdate 120814050000Z -enddate 120814060000Z -in clientcert.csr -out clientcert.pem -CA cacert.pem -CAkey cakey.pem -CAcreateserial
unknown option 120814050000Z
usage: x509 args
.
.
-startdate - notBefore field
-enddate - notAfter field
.
.
-days arg - How long till expiry of a signed certificate - def 30 days