この節では、Web Server で使用する Solaris 暗号化の構成方法について説明します。
次のコマンドを使用して、マシンから ./sunw ディレクトリを削除します。
%rm -rf $HOME/.sunw
次のコマンドを使用して新しい PIN を設定します。
% pktool setpin Enter new PIN:<ここに PIN を入力>
Re-enter new PIN:<PIN を再入力>
次のコマンドを使用して、pkcs11_kernel.so および pkcs11_softtoken.so ファイル内の機構を無効にします。
#cryptoadm disable provider=/usr/lib/security/$ISA/pkcs11_kernel.so mechanism=CKM_SSL3_PRE_MASTER_KEY_GEN,CKM_SSL3_MASTER_KEY_DERIVE,CKM_SSL3_KEY AND_MAC_DERIVE,CKM_SSL3_MASTER_KEY_DERIVE_DH,CKM_SSL3_MD5_MAC,CKM_SSL3_SHA1_MAC
#cryptoadm disable provider=/usr/lib/security/$ISA/pkcs11_softtoken.so mechanism=CKM_SSL3_PRE_MASTER_KEY_GEN,CKM_SSL3_MASTER_KEY_DERIVE,CKM_SSL3_KEY AND_MAC_DERIVE,CKM_SSL3_MASTER_KEY_DERIVE_DH,CKM_SSL3_MD5_MAC,CKM_SSL3_SHA1_MAC
pkcs11_softtoken_extra.so ファイル内の機構を使用している場合は、これを必ず無効にしてください。
次のコマンドを入力して、Solaris 暗号化フレームワークを config ディレクトリ内のネットワークセキュリティーサービス (NSS) に追加します。
$ cd <install-dir>/<instance-dir>/lib/modutil -dbdir <install-dir>/<instance-dir>/config -nocertdb -add "scf" -libfile /usr/lib/libpkcs11.so -mechanisms RSA
次のコマンドを使用して、登録を検証します。
$cd <install-dir>/<instance-dir>/lib/modutil -dbdir <install-dir>/<instance-dir>/config -nocertdb -list
Listing of PKCS #11 Modules 1. NSS Internal PKCS #11 Module slots: 2 slots attached status: loaded slot: NSS Internal Cryptographic Services token: NSS Generic Crypto Services slot: NSS User Private Key and Certificate Services token: NSS Certificate DB 2. scf library name: /usr/lib/libpkcs11.so slots: 1 slot attached status: loaded slot: Sun Crypto Softtoken token: Sun Software PKCS#11 softtoken 3. Root Certs library name: libnssckbi.so slots: There are no slots attached to this module status: Not loaded
サーバー証明書の作成について詳しくは、「証明書の要求」を参照してください。
証明書が NSS データベース内に存在する場合は、次の pk12util コマンドを使用して証明書をエクスポートまたはインポートできます。
$pk12util -o server.pk12 -d . -n <server-cert>
$pk12util -i server.pk12 -d . -h "Sun Software PKCS#11 softtoken"
デフォルトでは、certutil/pk12util はデータベース内で cert8.db および key3.db を検索します。Web Server のプレフィックスとして -P を追加します。これにより、代替名 https-instance-hostname-cert8.db および https-instance-hostname-key3.db が使用されます。
「ホーム」ページから、「構成」タブをクリックします
「構成」ページで、PKCS11 を有効にする構成をクリックします。
「証明書」タブをクリックします。
「PKCS#11 トークン」サブタブをクリックします。
「一般設定」で、チェックボックスを選択して PKCS#11 を有効にして、「バイパスを許可」を選択します。
「保存」ボタンをクリックします。
CLI リファレンスの set-pkcs11-prop(1) を参照してください。
インストールディレクトリから wadm を起動して、次の手順を実行します。
$wadm --user=admin Please enter admin-user-password>enter the administration serverpassword $wadm>list-tokens --config=test.sun.com internal Sun Software PKCS#11 softtoken $wadm>create-selfsigned-cert --config=test.sun.com --server-name=test.sun.com --nickname=MyCert --token="Sun Software PKCS#11 softtoken" Please enter token-pin>enter the password CLI201 Command 'create-selfsigned-cert' ran successfully $wadm>set-ssl-prop --config=test.sun.com --http-listener=http-listener-1 enabled=true server-cert-nickname="Sun Software PKCS#11 softtoken:MyCert" CLI201 Command 'set-ssl-prop' ran successfully $wadm>deploy-config test.sun.com CLI201 Command 'deploy-config' ran success
ここで、管理サーバーを起動します。
$ cd <install-dir>/<instance-dir>/bin/startserv Sun Java System Web Server 7.0 Update 3 Please enter the PIN for the "Sun Software PKCS#11 softtoken" token:enter the password info: HTTP3072: http-listener-1: https://test.sun.com:2222 ready to accept requests info: CORE3274: successful server startup