目次
CA局の構築
まずは、OpenSSLをCA局として動作するようにして見ましょう。
CA.plというperlで書かれたスクリプトを使うことで、簡単にCA局を構築できます。
CA.plは、CA局の構築時の他にもCSRの生成やCSRへの署名などを簡単に行う機能があります。CA.plを使用すると、細かなパラメータを入力する必要が無く簡単でいいのですが、それら細かなパラメータはデフォルトの値を使うことになります。細かなパラメータをいろいろ調整したい場合には、デフォルトの値を変更してCA.plを使うか、opensslコマンドを直接操作し、細かなパラメータまで指定することになります。
ここでは、CA.plを使って簡単にCA局を構築してみます。
CA局構築
C:\OpenSSL\bin>CA.pl -newca
CA certificate filename (or enter to create)
<----■Enter■
Making CA certificate ...
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
.............................++++++
..................++++++
writing new private key to './demoCA/private/cakey.pem'
Enter PEM pass phrase: <----■CA局秘密鍵のパスフレーズを決めて入力(パスフレーズ1とします)■
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 <---■これ以降、CA局の情報を入力■
State or Province Name (full name) [Some-State]:TOKYO
Locality Name (eg, city) []:Shinjuku
Organization Name (eg, company) [Internet Widgits Pty Ltd]:myCA_LTD
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:TEST_CA
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: <---■Enter■
An optional company name []: <---■Enter■
Using configuration from C:\OpenSSL\bin\openssl.cnf
Loading 'screen' into random state - done
Enter pass phrase for ./demoCA/private/cakey.pem: <---■はじめに決めた
CA局秘密鍵のパスフレーズ「パスフレーズ1」を入力■
Check that the request matches the signature
Signature ok
Certificate Details: ■以下に証明書の情報が表示される■
Serial Number:
ef:7e:29:b0:59:27:bc:9e
Validity
Not Before: Dec 29 15:14:45 2007 GMT
Not After : Dec 28 15:14:45 2010 GMT
Subject:
countryName = JP
stateOrProvinceName = TOKYO
organizationName = myCA_LTD
commonName = TEST_CA
X509v3 extensions:
X509v3 Subject Key Identifier:
47:6B:70:BE:60:F0:86:AB:8B:CC:29:F7:49:04:AE:84:36:2E:A8:8F
X509v3 Authority Key Identifier:
keyid:47:6B:70:BE:60:F0:86:AB:8B:CC:29:F7:49:04:AE:84:36:2E:A8:8F
DirName:/C=JP/ST=TOKYO/O=myCA_LTD/CN=TEST_CA
serial:EF:7E:29:B0:59:27:BC:9E
X509v3 Basic Constraints:
CA:TRUE
Certificate is to be certified until Dec 28 15:14:45 2010 GMT (1095 days)
Write out database with 1 new entries
Data Base Updated
何ができたのか確認
C:\OpenSSL\bin>dir | more
ドライブ C のボリューム ラベルがありません。
ボリューム シリアル番号は 54A5-8EF0 です
C:\OpenSSL\bin のディレクトリ
2007/12/30 00:09 <DIR> .
2007/12/30 00:09 <DIR> ..
2007/12/30 00:14 1,024 .rnd
2007/10/22 07:10 9,728 bftest.exe
2007/10/22 07:10 22,016 bntest.exe
2007/10/19 01:32 5,868 CA.pl
2007/10/22 07:10 5,632 casttest.exe
2007/12/30 00:14 <DIR> demoCA <---■demoCA
ディレクトリができている■
2007/10/22 07:10 14,848 destest.exe
2007/10/22 07:10 6,656 dhtest.exe
2007/10/22 07:10 6,144 dsatest.exe
2007/10/22 07:10 7,680 ecdhtest.exe
...以下省略...
最終更新:2007年12月31日 18:22