Help us understand the problem. What is going on with this article?

OpenSSLでX.509 v3の証明書を作成する

More than 1 year has passed since last update.

OpenSSLを勉強して、X.509 v3の証明書を作ってみたかったのでメモ。

extension fileを作成

以下のファイルを作成します。

v3.txt
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment

それぞれの値の意味はここら辺にあります。m(_ _)m
https://www.openssl.org/docs/manmaster/man5/x509v3_config.html

参考サイト
https://stackoverflow.com/questions/18233835/creating-an-x509-v3-user-certificate-by-signing-csr

証明書作成のコマンドを実行

ポイントはopenssl x509コマンドを実行するときに、-extfileオプションを指定することです。
これ「-extfile v3.txt」を追加します。

全体としては、以下のコマンドになります。

$ openssl x509 -in server.csr -req -out server.crt -days 365 -signkey server.key -sha256 -extfile v3.txt

確認...

$ openssl x509 -in server.crt -text | grep Version
        Version: 3 (0x2)
SRsawaguchi
Webサービス作ってます。
http://lambda.tokyo
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした