11.2. 使用方法
- 次のコマンドを実行して、tkstool のバージョンを確認します。
tkstool -Vこのコマンドを実行すると、以下のような出力が返されます。tkstool: Version 1.0 - 新しいソフトウェアデータベースを作成します。
tkstool -N -d . Enter a password which will be used to encrypt your keys. The password should be at least 8 characters long, and should contain at least one non-alphabetic character. Enter new password: Re-enter password:注記modutil ユーティリティーが最初に HSM スロットとトークンをsecmod.dbデータベースに挿入するために使用される場合は、ハードウェア HSM をソフトウェアデータベースの代わりに使用できます。HSM を使用する場合は、以下のコマンドにオプション -h hsm_token を追加する必要があります。 - ローカルソフトウェアキーデータベースの内容を一覧表示します。
tkstool -L -d . slot: NSS User Private Key and Certificate Services token: NSS Certificate DB Enter Password or Pin for "NSS Certificate DB": tkstool: the specified token is empty - transport という トランスポート キーを作成します。
tkstool -T -d . -n transport - プロンプトが表示されたら、データベースのパスワードを入力し、noise と入力して乱数ジェネレーターを確認します。
- セッションキー共有と対応する KCV が表示されます。これら両方を書き留めておきます。
- 以下のコマンドを実行して、同一のトランスポートキーを生成します。これは通常、同一のトランスポートキーを使用する必要がある別のデータベースセット内で使用されます。これが実行されると、複数のセッションキー共有と KCV が生成されます。この情報をすべて書き留めておきます。
tkstool -I -d . -n verify_transport以下のような応答が表示されます。Generating first symmetric key . . . Generating second symmetric key . . . Generating third symmetric key . . . Extracting transport key from operational token . . . transport key KCV: A428 53BA Storing transport key on final specified token . . . Naming transport key "transport" . . . Successfully generated, stored, and named the transport key! - キーデータベースの内容を再度一覧表示します。
tkstool -L -d . slot: NSS User Private Key and Certificate Services token: NSS Certificate DB Enter Password or Pin for "NSS Certificate DB": 0 transport - トランスポートキーを使用してマスターキーを生成してラップし、マスターキーをファイル と呼ばれる ファイル に保存します。
tkstool -W -d . -n wrapped_master -t transport -o file Enter Password or Pin for "NSS Certificate DB": Retrieving the transport key (for wrapping) from the specified token . . . Generating and storing the master key on the specified token . . . Naming the master key "wrapped_master" . . . Successfully generated, stored, and named the master key! Using the transport key to wrap and store the master key . . . Writing the wrapped data (and resident master key KCV) into the file called "file" . . . wrapped data: 47C0 06DB 7D3F D9ED FE91 7E6F A7E5 91B9 master key KCV: CED9 4A7B (computed KCV of the master key residing inside the wrapped data) - ソフトウェアキーデータベースの内容を再度一覧表示します。
tkstool -L -d . slot: NSS User Private Key and Certificate Services token: NSS Certificate DB Enter Password or Pin for "NSS Certificate DB": 0 wrapped_master 1 transport注記キーの順序は重要ではなく、一部のシステムでは別の順序でキーが表示される場合があります。 - トランスポートキーを使用して、ファイル と呼ばれるファイルに保存される unwrapped_master というマスターキーを生成およびアンラップします。
tkstool -U -d . -n unwrapped_master -t transport -i file Enter Password or Pin for "NSS Certificate DB": Retrieving the transport key from the specified token (for unwrapping) . . . Reading in the wrapped data (and resident master key KCV) from the file called "file" . . . wrapped data: 47C0 06DB 7D3F D9ED FE91 7E6F A7E5 91B9 master key KCV: CED9 4A7B (pre-computed KCV of the master key residing inside the wrapped data) Using the transport key to temporarily unwrap the master key to recompute its KCV value to check against its pre-computed KCV value . . . master key KCV: CED9 4A7B (computed KCV of the master key residing inside the wrapped data) master key KCV: CED9 4A7B (pre-computed KCV of the master key residing inside the wrapped data) Using the transport key to unwrap and store the master key on the specified token . . . Naming the master key "unwrapped_master" . . . Successfully unwrapped, stored, and named the master key! - キーデータベースの内容を一覧表示し、すべてのキーを表示します。
tkstool -L -d . slot: NSS User Private Key and Certificate Services token: NSS Certificate DB Enter Password or Pin for "NSS Certificate DB": 0 unwrapped_master 1 wrapped_master 2 transport - データベースからキーを削除します。
tkstool -D -d . -n wrapped_master Enter Password or Pin for "NSS Certificate DB": tkstool: 1 key(s) called "wrapped_master" were deleted - キーデータベースの内容を再度一覧表示して、すべてのキーを表示します。
tkstool -L -d . slot: NSS User Private Key and Certificate Services token: NSS Certificate DB Enter Password or Pin for "NSS Certificate DB": 0 unwrapped_master 1 transport