Skip to content

Instantly share code, notes, and snippets.

@takuma-saito
Last active August 20, 2020 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuma-saito/44ea9462e859d413928e to your computer and use it in GitHub Desktop.
Save takuma-saito/44ea9462e859d413928e to your computer and use it in GitHub Desktop.
ore-ore-sign
$ openssl req -new -nodes -newkey rsa:2048 -keyout server.key -batch -subj '/C=JP/ST=Tokyo/L=Tokyo/O=Company/OU=Web/CN=example.jp' > server.csr # 組織の場合
$ openssl req -new -nodes -newkey rsa:2048 -keyout server.key -batch -subj '/emailAddress=your_mail_address@gmail.com/CN=YOUR NAME/C=JP' > server.csr # 個人の場合
$ openssl x509 -days 3650 -req -signkey server.key < server.csr > server.crt
$ diff <(openssl x509 -modulus -in server.crt | grep Modulus) <(openssl rsa -modulus -in server.key | grep Modulus)
# csr 確認
$ openssl req -text -in server.csr
# crt 確認
$ openssl x509 -text -in server.csr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment