---
schema_version: "1"
id: f8a6d1ccf92977d685d954640d3fe46e6183f595524de31c90e4b21d0964e6b0
title: JAR 署名バリデーター
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/runtime-manager/rtm-agent-jar-signature-validator.md
canonical_url: https://docs.mulesoft.com/jp/runtime-manager/rtm-agent-jar-signature-validator
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8140edbd852b7477090f45b705134114e0a3c11b5d76a8169d6e69c6da4ef5b7
description: MuleSoft Documentation Site
latest: true
---
# JAR 署名バリデーター

デフォルトでは、アプリケーションバリデーターサービスは JAR 署名バリデーターを実装し、認証されていないアーティファクトのデプロイを禁止します。 アーティファクト JAR ファイルのそれぞれの署名済みエントリが、キーストアのいずれかの別名と一致する必要があります。 ランタイムにデプロイされたすべてのアーティファクトを検証するために使用するキーストアの別名を指定できます。期限切れの証明書で署名されたアーティファクトも使用できます。

## [](#jar-signatureバリデーターを設定する)JAR Signatureバリデーターを設定する

`$MULE_HOME/conf/mule-agent.yml`​ ファイルを変更して次を含めます。

```java
 services:
  mule.agent.artifact.validator.service:
    enabled: true
    validators:
    - type: jarSignatureValidator
      name: defaultJarSignatureValidator
      enabled: true
      args:
        truststore: signers-truststore.jks
        truststoreType: JKS
        truststoreAlias: code-signer-alias-1
        truststorePassword: '![PBEWITHSHA1ANDDESEDE,U/nA0wV714oNi9LHoAkDtiwg22ngG6b7yFTtg7fk2d4=]'
```

次のプロパティを使用して、JAR 署名バリデーターを設定します。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 14.2857%;">
<col style="width: 85.7143%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">キー</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>type</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>必須。  <code>jarSignatureValidator</code>​ は、Mule Runtime のデプロイメントに使用されるすべての JAR ファイルの署名を検証するために、Runtime Manager エージェントプラグインで実装されるバリデーター種別です。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>name</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>必須。1 つのバリデーター種別は複数の実装を持つことができます。Runtime Manager エージェントで実装される ​<code>jarSignatureValidator</code>​ 種別の名前は ​<code>defaultJarSignatureValidator</code>​ です。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>enabled</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>省略可能。バリデーターの実装を有効にするには ​<code>true</code>​、無効にするには ​<code>false</code>​ に設定します。デフォルト値は ​<code>true</code>​ です。</p>
</div></div></td>
</tr>
</tbody>
</table>

次の引数を使用して、JAR 署名バリデーターを設定します。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 14.2857%;">
<col style="width: 85.7143%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">キー</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>トラストストア</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>省略可能。デプロイメントに使用するすべての JAR ファイルの署名を検証するために使用する 1 つ以上の証明書を含むトラストストアのファイル名。デフォルトの場所は ​<code>$MULE_HOME/conf</code>​ です。相対パスを使用してトラストストアファイルを参照できます。パスを指定しないと、バリデーターは JVM で使用する cacerts トラストストアファイルを読み込みます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>truststoreType</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>省略可能。  <code>JKS</code>​ (デフォルト) または ​<code>PKCS12</code>​。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>truststoreAlias</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>省略可能。トラストストアファイルに保存されている各証明書は、別名文字列で識別されます。このプロパティは、すべての JAR ファイルの検証に使用する単一の別名を指定します。別名を指定しなかった場合、バリデーターはトラストストアのすべての証明書を使用して JAR ファイルの署名を検証します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>truststorePassword</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>JKS では省略可能ですが、PKCS12 では必須です。トラストストアファイルのパスワード。</p>
</div></div></td>
</tr>
</tbody>
</table>

## [](#mule-runtime-engine-を起動する)Mule Runtime Engine を起動する

Mule Runtime Engine を起動し、バリデーターが正常に設定されたことを確認します。コンソールに次のログが表示されます。

```console
AgentApplicationValidatorService: Initializing Artifact Validator service
AgentApplicationValidatorService: Total validators loaded: 1
AgentApplicationValidatorService: Validators listed by type:
AgentApplicationValidatorService: Type: jarSignatureValidator Names: [defaultJarSignatureValidator]
```

## [](#ユースケース-1-信頼できるコード署名者によって署名された-jar-ファイルのデプロイ-成功)ユースケース 1: 信頼できるコード署名者によって署名された JAR ファイルのデプロイ - 成功

必要なファイル:

- `app-signed-by-trust-signer-01.jar`
- `signers-truststore.jks`

ファイル: `mule-agent.yaml`

```java
 services:
  mule.agent.artifact.validator.service:
    enabled: true
    validators:
    - type: jarSignatureValidator
      name: defaultJarSignatureValidator
      enabled: true
      args:
        truststore: signers-truststore.jks
        truststoreType: JKS
        truststorePassword: mulesoft
```

curl コマンド:

```copy
curl -X PUT 'http://localhost:9999/mule/applications/app-signed-by-trust-signer-01' \
     -H 'Content-Type: application/json' \
     -d '{"url": "file:/tmp/yahoo/app-signed-by-trust-signer-01.jar", \
          "configuration": {}
         }'
```

応答:

```json
{
  "application": {
     "name": "app-signed-by-trust-signer-01"
   },
  "status": "Deployment attempt started"
}
```

コンソールログ:

```console
AgentApplicationService: Deploying the app-signed-by-trust-signer-01 application from URL file:/tmp/yahoo/app-signed-by-trust-signer-01.jar
KeystoreUtils: Loading Jar Signers Truststore from '/private/tmp/trash/server-yahoo/conf/signers-truststore.jks'
JarSigner: Jar Signature verified: File /var/folders/sq/71l1hxdn171dpc46fn675yk80000gq/T/mule-received-artifact-5158252349422012120/app-signed-by-trust-signer-01.jar
AgentApplicationValidatorService: Application validation success for application: 'app-signed-by-trust-signer-01'
```

## [](#ユースケース-2-信頼できるコード署名者によって署名された-jar-ファイルをデプロイしトラストストアの別名署名者で検証-成功)ユースケース 2: 信頼できるコード署名者によって署名された JAR ファイルをデプロイし、トラストストアの別名署名者で検証 - 成功

必要なファイル:

- `app-signed-by-trust-signer-01.jar`
- `signers-truststore.jks`

ファイル: `mule-agent.yaml`

```java
 services:
  mule.agent.artifact.validator.service:
    enabled: true
    validators:
    - type: jarSignatureValidator
      name: defaultJarSignatureValidator
      enabled: true
      args:
        truststore: signers-truststore.jks
        truststoreType: JKS
        truststoreAlias: code-signer-alias-01
        truststorePassword: mulesoft
```

curl コマンド:

```copy
curl -X PUT http://localhost:9999/mule/applications/app-signed-by-trust-signer-01
     -H "Content-Type: application/json"
     -d '{"url": "file:/tmp/yahoo/app-signed-by-trust-signer-01.jar",\
          "configuration": {}
         }'
```

応答:

```json
{
  "application": {
     "name": "app-signed-by-trust-signer-01"
    },
  "status": "Deployment attempt started"
}
```

コンソールログ:

```console
AgentApplicationService: Deploying the app-signed-by-trust-signer-01 application from URL file:/tmp/yahoo/app-signed-by-trust-signer-01.jar
KeystoreUtils: Loading Jar Signers Truststore from '/private/tmp/trash/server-yahoo/conf/signers-truststore.jks'
JarSigner: Jar Signature verified using certificate alias 'code-signer-alias-01': File '/var/folders/sq/71l1hxdn171dpc46fn675yk80000gq/T/mule-received-artifact-3796117303843373481/app-signed-by-trust-signer-01.jar'
AgentApplicationValidatorService: Application validation success for application: 'app-signed-by-trust-signer-01'
```

## [](#ユースケース-3-期限切れのコード署名者によって署名された-jar-ファイルのデプロイ-失敗)ユースケース 3: 期限切れのコード署名者によって署名された JAR ファイルのデプロイ - 失敗

必要なファイル:

- `app-signed-by-expired-trusted-signer.jar`
- `signers-truststore.jks`

ファイル: `mule-agent.yaml`

```java
services:
  mule.agent.artifact.validator.service:
    enabled: true
    validators:
    - type: jarSignatureValidator
      name: defaultJarSignatureValidator
      enabled: true
      args:
        truststore: signers-truststore.jks
        truststoreType: JKS
        truststoreAlias: expired-code-signer
        truststorePassword: mulesoft
```

curl コマンド:

```copy
curl -X PUT http://localhost:9999/mule/applications/app-signed-by-expired-trusted-signer \
     -H "Content-Type: application/json"
     -d '{"url": "file:/tmp/yahoo/app-signed-by-expired-trusted-signer.jar", \
          "configuration": {}
         }'
```

応答:

```json
{
  "type": "class com.mulesoft.agent.exception.ApplicationValidationException",
  "message": "CertificateExpiredException - NotAfter: Wed Dec 22 14:45:54 AST 2021"
}
```

コンソールログ:

```console
AgentApplicationService: Deploying the app-signed-by-expired-trusted-signer application from URL file:/tmp/yahoo/app-signed-by-expired-trusted-signer.jar
KeystoreUtils: Loading Jar Signers Truststore from '/private/tmp/trash/server-yahoo/conf/signers-truststore.jks'
MuleAgentSignatureValidator: There was an error validating the certificate with the alias 'expired-code-signer' - CertificateExpiredException Reason: 'NotAfter: Wed Dec 22 14:45:54 AST 2021'
ApplicationsRequestHandler: Error performing the deployment of app-signed-by-expired-trusted-signer. Cause: ApplicationValidationException: CertificateExpiredException - NotAfter: Wed Dec 22 14:45:54 AST 2021
```

## [](#関連情報)関連情報

- [Runtime Manager エージェント](https://docs.mulesoft.com/jp/runtime-manager/runtime-manager-agent)
- [高度な用途](https://docs.mulesoft.com/jp/runtime-manager/advanced-usage)
- [アプリケーションバリデーターサービス](https://docs.mulesoft.com/jp/runtime-manager/rtm-agent-app-validator)