C.2. modutil
- PKCS #11 モジュールの追加および削除
- パスワードの変更
- デフォルトの設定
- モジュールコンテンツの一覧表示
- スロットの有効化または無効化
- FIPS(Federal Information Processing Standard)140-2 コンプライアンスの有効化または無効化
- 暗号化操作のデフォルトプロバイダーの割り当て
key3.db、cert8.db、およびsecmod.dbセキュリティーデータベースの作成。
8.db ファイル)を管理するプロセスの一部です。キー、証明書、および PKCS #11 モジュール管理プロセスは、通常、証明書と証明書データベースを生成および管理するために必要な鍵と鍵データベースの作成から開始します。
場所
modutil ツールは /usr/bin フォルダーにあります。
構文
modutil task [option]
タスクおよびオプション
modutil ツールを使用して、さまざまなタスクを実行できます。これらのタスクは、コマンドおよびオプションを使用して指定します。コマンドは、実行するタスクを指定します。オプションは、タスクコマンドを変更します。
| タスク | 詳細 | 許可されるオプション | ||
|---|---|---|---|---|
| -add moduleName | PKCS #11 モジュールをデータベースに追加します。 |
| ||
| -changepw token | 名前付きトークンのパスワードを変更します。トークンが初期化されていない場合、このオプションは提供されたパスワードで初期化されます。この場合、password という用語は、個人 ID 番号(PIN)と同等です。 |
| ||
| -create | 新しい secmod.db ファイル、key3.db ファイル、および cert8.db ファイルを作成します。指定したディレクトリーにこれらのセキュリティーデータベースが存在する場合は、modutil ツールにエラーメッセージが表示されます。 |
| ||
| -default moduleName | named モジュールがデフォルトのプロバイダーであるセキュリティーメカニズムを設定します。 |
| ||
| -delete moduleName | named モジュールを削除します。内部 PKCS #11 モジュールを削除することはできません。 | |||
| -disable moduleName | named モジュールの全スロットを無効にします。特定のスロットを無効にするには、- slot オプションを使用します。 |
| ||
| -enable moduleName | named モジュールの全スロットを有効にします。特定のスロットを有効にするには、- slot オプションを使用します。 |
| ||
| -fips true|false | Directory Server で FIPS 140-2 コンプライアンスモードを有効または無効にします。詳細は、『 『Directory Server 管理ガイド』』の 「FIPS モードサポートの管理 」を参照してください。 | |||
| -force | スクリプトから実行できるように、modutil ツールの対話式プロンプトを無効にします。このコマンドは、計画された各操作を手動でテストして警告を確認し、プロンプトをバイパスすると、データベースの整合性がなくなるか、失われるようにします。 | |||
| -jar JARfile |
新しい PKCS #11 モジュールをデータベースに追加します。モジュールは名前付き JAR ファイルに含まれる必要があります。
JAR ファイルは、インストールするすべてのファイル、モジュール名、およびメカニズムフラグを識別します。また、PKCS #11 モジュールライブラリーやドキュメントなどの他のファイルなど、ターゲットマシンにインストールするファイルも含まれる必要があります。
JAR ファイルは Netscape Server PKCS #11 JAR 形式を使用します。JAR ファイルの作成に関する詳細は、JAR 情報ファイル を参照してください。
|
| ||
| -list [moduleName] | secmod.db ファイルの内容に関する基本情報を表示します。スロットやトークンなど、特定のモジュールに関する詳細情報を表示するには、moduleName の値を指定します 。 | |||
| -undefault moduleName | named モジュールがデフォルトのプロバイダーでは ない セキュリティーメカニズムを指定します。 |
|
| オプション | 詳細 |
|---|---|
| -dbdir dbFolder | セキュリティーモジュールのデータベースファイルにアクセスまたは作成するフォルダーを指定します。この引数は、すべてのコマンドに必要になります。これは、Administration Server 設定ディレクトリーを参照する必要があります。以下に例を示します。
|
| -installdir installation_directory | -jar JAR-file タスクで提供されるファイルのルートインストールフォルダーを指定します。installation_directory ディレクトリーは、動的ライブラリーファイルを保存するのに適したものである必要があります。 |
| -libfile libraryFile | データベースに追加される PKCS #11 モジュールが含まれるライブラリーファイルを指定します。完全パスを使用してファイルを特定します。 |
| -mechanisms mechanismList | 特定のモジュールがデフォルトのプロバイダーであるセキュリティーメカニズムを指定します。mechanismList は、メカニズム名のコロン区切りリストです。スペースが含まれている場合は、この一覧を引用符で囲みます。モジュールは、これらのメカニズムが有効な場合にリストされたメカニズムのデフォルトプロバイダーになります。メカニズムのデフォルトプロバイダーとして複数のモジュールが割り当てられている場合、メカニズムのデフォルトプロバイダーは undefined として一覧表示されます。以下のメカニズムが現在利用できます。
|
| -newpwfile newPasswordFile | トークンの新規パスワードが含まれるテキストファイルを指定します。これにより、- changepw コマンドの使用時にパスワードを自動的に更新できます。 |
| -nocertdb | modutil が、証明書やキーデータベースを開くように指示しません。これにはいくつかの影響があります。
|
| -pwfile passwordFile | トークンの現在のパスワードが含まれるテキストファイルを指定します。これにより、- changepw コマンドの使用時にパスワードの自動エントリーが可能になります。 |
| -slot slotName | -enable コマンドまたは -disable コマンドの使用時に、有効または無効にする 特定のスロットを指定します。 |
| -tempdir temporaryFolder | -jar コマンドによって作成された一時ファイルを保存するフォルダーを指定します。一時フォルダーを指定しないと、現在のフォルダーが使用されます。 |
JAR 情報ファイル
JAR(Java アーカイブ)は、多くのファイルを 1 つに集約するプラットフォームに依存しないファイル形式です。JAR ファイルは、modutil を使用して PKCS #11 モジュールをインストールします。modutil が JAR ファイルを使用する場合は、特別な JAR 情報ファイルを含める必要があります。この情報ファイルには、特別なスクリプト命令が含まれ、JAR ファイルの MANIFEST ファイルに指定する必要があります。情報ファイルには任意の名前を指定できますが、P kcs11_install_script METAINFO コマンドを使用して指定します。
+ Pkcs11_install_script: pk11install
例C.1 JAR ファイルの例
ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc }
Platforms {
Linux:2.0.32:x86 {
ModuleName { "Fortezza Module" }
ModuleFile { win32/fort32.dll }
DefaultMechanismFlags{0x00000001 }
CipherEnableFlags{ 0x00000001 }
Files {
win32/setup.exe {
Executable
RelativePath { %temp%/setup.exe }
}
win32/setup.hlp {
RelativePath { %temp%/setup.hlp }
}
win32/setup.cab {
RelativePath { %temp%/setup.cab }
}
}
}
Linux:2.0.32:x86 {
EquivalentPlatform {WINNT::x86}
}
SUNOS:5.5.1:sparc {
ModuleName { "Fortezza UNIX Module" }
ModuleFile { unix/fort.so }
DefaultMechanismFlags{ 0x00000001 }
CipherEnableFlags{ 0x00000001 }
Files {
unix/fort.so {
RelativePath{%root%/lib/fort.so}
AbsolutePath{/usr/local/Red Hat/lib/fort.so}
FilePermissions{555}
}
xplat/instr.html {
RelativePath{%root%/docs/inst.html}
AbsolutePath{/usr/local/Red Hat/docs/inst.html}
FilePermissions{555}
}
}
}
IRIX:6.2:mips {
EquivalentPlatform { SUNOS:5.5.1:sparc}
}
}
グローバルキー
グローバルキーは、JAR 情報ファイルのプラットフォーム固有のセクションを定義します。ForwardCompatible と Platforms の 2 つのグローバルキーがあります。
ForwardCompatible { Solaris:5.5.1:sparc }
system name:OS release:architecture
- HP-UX(hppa1.1)
- Linux(x86)は x86_64 を認識していますか?
- Solaris(sparc)
Linux:5.2.0:x86
| mechanism | 16 進数のビット値 |
|---|---|
| RSA | 0x00000001 |
| DSA | 0x00000002 |
| RC2 | 0x00000004 |
| RC4 | 0x00000008 |
| DES | 0x00000010 |
| DH | 0x00000020 |
| FORTEZZA | 0x00000040 |
| RC5 | 0x00000080 |
| SHA1 | 0x00000100 |
| MD5 | 0x00000200 |
| MD2 | 0x00000400 |
| RANDOM | 0x08000000 |
| 平易 | 0x10000000 |
| OWN_PW_DEFAULTS | 0x20000000 |
| DISABLE | 0x40000000 |
ファイルごとのキー
これらのキーは、ファイル リスト内のエントリー内にのみ意味を持ちます。少なくとも、RelativePath または AbsolutePath を指定する必要があります。両方を指定すると、相対パスが最初に試行され、modutil によって相対ルートフォルダーが指定されていない場合に絶対パスが使用されます。
setup.exe プログラム (%temp% フォルダーにある)が実行可能ファイルであることを指定するには、JAR 情報ファイルに以下の行を追加します。
Executable
RelativePath { %temp%/setup.exe }
| ファイル権限 | Bitstring 値 |
|---|---|
| ユーザー読み取り | 400 |
| ユーザー書き込み | 200 |
| ユーザー実行 | 100 |
| グループの読み取り | 040 |
| GroupWrite | 020 |
| Group Execute | 010 |
| その他の読み取り | 004 |
| 他の書き込み | 002 |
| その他実行 | 001 |
例C.2 データベースファイルの作成
# modutil -create -dbdir /etc/dirsrv/admin-serv
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Creating "/etc/dirsrv/admin-serv/key3.db"...done.
Creating "/etc/dirsrv/admin-serv/cert8.db"...done.
Creating "/etc/dirsrv/admin-serv/secmod.db"...done.
例C.3 モジュール情報の表示
# modutil -list -dbdir /etc/dirsrv/admin-serv
Using database directory /etc/dirsrv/admin-serv...
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
-----------------------------------------------------------
例C.4 デフォルトプロバイダーの設定
# modutil -default "Cryptographic Module" -dbdir /etc/dirsrv/admin-serv -mechanisms RSA:DSA:RC2
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Using database directory /etc/dirsrv/admin-serv...
Successfully changed defaults.
例C.5 スロットの有効化
# modutil -enable "Cryptographic Module" -slot "Cryptographic Reader" -dbdir /etc/dirsrv/admin-serv
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Using database directory /etc/dirsrv/admin-serv...
Slot "Cryptographic Reader" enabled.
例C.6 FIPS コンプライアンスの有効化
# modutil -fips true
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
FIPS mode enabled.
例C.7 暗号モジュールの追加
# modutil -dbdir "/etc/dirsrv/admin-serv" -add "Cryptorific Module" -libfile "/crypto.dll" -mechanisms RSA:DSA:RC2:RANDOM
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Using database directory /etc/dirsrv/admin-serv...
Module "Cryptorific Module" added to database.
例C.8 JAR ファイルからの Cryptographic モジュールのインストール
Platforms {
Linux:2.0.32:x86 {
ModuleName { "SuperCrypto Module" }
ModuleFile { crypto.dll }
DefaultMechanismFlags{0x0000}
CipherEnableFlags{0x0000}
Files {
crypto.dll {
RelativePath{ %root%/system32/crypto.dll }
}
setup.exe {
Executable
RelativePath{ %temp%/setup.exe }
}
}
}
Win95::x86 {
EquivalentPlatform { Winnt::x86 }
}
}
# modutil -dbdir "/etc/dirsrv/admin-serv" -jar install.jar -installdir "/etc"
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Using database directory /etc/dirsrv/admin-serv...
This installation JAR file was signed by:
----------------------------------------------
**SUBJECT NAME**
C=US, ST=California, L=Mountain View, CN=SuperCrypto Inc.,
OU=Digital ID Class 3 - Red Hat Object Signing,
OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6",
OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign,
OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign,
Inc.", O=VeriSign Trust Network **ISSUER NAME**,
OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign,
OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign,
Inc.", O=VeriSign Trust Network
----------------------------------------------
Do you wish to continue this installation? (y/n)
Using installer script "installer_script"
Successfully parsed installation script
Current platform is Linux:2.0.32:x86
Using installation parameters for platform Linux:2.0.32:x86
Installed file crypto.dll to /winnt/system32/crypto.dll
Installed file setup.exe to ./pk11inst.dir/setup.exe
Executing "./pk11inst.dir/setup.exe"... "./pk11inst.dir/setup.exe" executed successfully
Installed module "SuperCrypto Module" into module database
Installation completed successfully
例C.9 トークンのパスワードの変更
# modutil -dbdir "/etc/dirsrv/admin-serv" -changepw "Administration Server Certificate DB"
WARNING: Performing this operation while the browser is running could cause
corruption of your security databases. If the browser is currently running,
you should exit browser before continuing this operation. Type
'q <enter>' to abort, or <enter> to continue:
Using database directory /etc/dirsrv/admin-serv...
Enter old password:
Enter new password:
Re-enter new password:
Token "Administration Server Certificate DB" password changed successfully.