18.2. サーバーでシリアル化を有効にする
手順18.1 タスク
- SOA_ROOT ディレクトリーに移動します: cd SOA_ROOT。
- keytool コマンドを実行し、画面のプロンプトに従います。
keytool -genkey -alias droolsKey -keyalg RSA -keystore MyDroolsPrivateKeyStore.keystore Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: Test User What is the name of your organizational unit? [Unknown]: HR What is the name of your organization? [Unknown]: Test Org What is the name of your City or Locality? [Unknown]: Brisbane What is the name of your State or Province? [Unknown]: QLD What is the two-letter country code for this unit? [Unknown]: AU Is CN=Test User, OU=HR, O=Test Org, L=Brisbane, ST=QLD, C=AU correct? [no]: yes Enter key password for droolsKey (RETURN if same as keystore password): Re-enter new password:すべての質問に回答すると、パスワードで保護されたMyDroolsPrivateKeyStore.keystoreという名前のファイルが作成されます。このキーストアファイルには、パスワード drools とともに droolsKey という秘密鍵があります。このファイルを環境内の安全な場所に保存します。これ以降、これをkeystoredirと呼びます。重要上記のパスワードは単なる例であり、実稼動環境では使用しないでください。 - 設定ファイルを開きます: vi jboss-as/server/default/deploy/properties-service.xml
- 次のスニペットを
properties-service.xmlに追加して、JBoss Rules シリアライゼーション機能を使用するように JBoss Enterprise SOA Platform を設定します。<mbean code="org.jboss.varia.property.SystemPropertiesService" name="jboss:type=Service,name=SystemProperties"> <attribute name="Properties"> # Drools Security Serialization specific properties drools.serialization.sign=true drools.serialization.private.keyStoreURL=file://$keystoredir/MyDroolsPrivateKeyStore.keystore drools.serialization.private.keyStorePwd=drools drools.serialization.private.keyAlias=droolsKey drools.serialization.private.keyPwd=drools </attribute> </mbean> - drools.serialization.sign プロパティーを true に設定します
drools.serialization.sign=true- drools.serialization.private.keyStoreURL=<RL> は、秘密鍵ストアの場所の URL です。
- 上記の例で、
keystoredirとMyDroolsKeyStore.keystoreを、キーストアディレクトリーと、keytool で作成したキーストアの名前に置き換えます。 - drools.serialization.private.keyStorePwd=<password> は、プライベートキーストアにアクセスするためのパスワードです。
- drools.serialization.private.keyAlias=<key> は秘密鍵のキーエイリアス (識別子) です。
- drools.serialization.private.keyPwd=<password> は秘密鍵のパスワードです。
- ファイルを保存して終了します。
- サーバーインスタンスを再起動します。警告システムプロパティーが正しく設定されていない場合、ルールパッケージをビルドしようとすると、次のエラーが表示されます。
An error occurred building the package. Error signing object store: Key store with private key not configured. Please configure it properly before using signed serialization