Windows で OpecSSL

投稿者: | 2018-11-12

Windows で OpecSSL を使ってみた。。。
先ず ココ からソフトをDLする

インストールは 「Win64OpenSSL_Light-1_0_2p.exe」を管理者権限で実行

  PATH  に 『C:\OpenSSL-Win64\bin』を追記
  OPENSSL_CON に『C:\OpenSSL-Win64\bin\openssl.cfg』を設定する

こんな感じ ↓↓

C:\Users\Administrator> cd C:\OpenSSL-Win64\bin
C:\OpenSSL-Win64\bin> openssl req -new -text -out server.req  [enter]
Generating a 2048 bit RSA private key
writing new private key to ‘privkey.pem’
Enter PEM pass phrase:    <<< 適当なパスフレーズを入れる
Verifying – Enter PEM pass phrase:
Verify failure
Enter PEM pass phrase:
Verifying – Enter PEM pass phrase:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
Country Name (2 letter code) [AU]:JP  <<< 必須
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []
Email Address []:

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

C:\OpenSSL-Win64\bin> openssl rsa -in privkey.pem -out server.key  [enter]
Enter pass phrase for privkey.pem:
writing RSA key

C:\OpenSSL-Win64\bin> openssl req -x509 -in server.req -text -key server.key -out  server.crt  [enter]