

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# PKCS\$111 プロバイダ
<a name="pkcs11-provider-component"></a>

PKCS\$111 プロバイダコンポーネント (`aws.greengrass.crypto.Pkcs11Provider`) は、[PKCS\$111 インターフェイス](https://en.wikipedia.org/wiki/PKCS_11)を通してハードウェアセキュリティモジュール (HSM) を使用するため、 AWS IoT Greengrass Core ソフトウェアを設定できるようにします。このコンポーネントは、証明書とプライベートキーファイルを安全に保存できるようにして、ソフトウェアで公開または複製されないようにします。詳細については、「[ハードウェアセキュリティ統合](hardware-security.md)」を参照してください。

**注記**  
このコンポーネントは [Greengrass nucleus ](greengrass-nucleus-component.md)にのみ必要です。[Greengrass nucleus lite](greengrass-nucleus-lite-component.md) v2.5.0 以降には、PKCS\$111 のサポートが組み込まれており、このコンポーネントは必要ありません。詳細については、 AWS IoT Greengrass nucleus lite GitHub リポジトリの [PKCS\$111 サポート](https://github.com/aws-greengrass/aws-greengrass-lite/blob/main/docs/PKCS11_SUPPORT.md)を参照してください。

証明書とプライベートキーを HSM に保存する Greengrass コアデバイスをプロビジョニングするには、 AWS IoT Greengrass Core ソフトウェアをインストールするときに、このコンポーネントをプロビジョニングプラグインとして指定する必要があります。詳細については、「[手動リソースプロビジョニングを使用して AWS IoT Greengrass Core ソフトウェアをインストールする](manual-installation.md)」を参照してください。

AWS IoT Greengrass は、インストール時にプロビジョニングプラグインとして を指定するためにダウンロードできる JAR ファイルとしてこのコンポーネントを提供します。次の URL としてコンポーネントの JAR ファイルの最新バージョンをダウンロードできます: [https://d2s8p88vqu9w66.cloudfront.net/releases/Pkcs11Provider/aws.greengrass.crypto.Pkcs11Provider-latest.jar](https://d2s8p88vqu9w66.cloudfront.net/releases/Pkcs11Provider/aws.greengrass.crypto.Pkcs11Provider-latest.jar)。

**Topics**
+ [バージョン](#pkcs11-provider-component-versions)
+ [タイプ](#pkcs11-provider-component-type)
+ [オペレーティングシステム](#pkcs11-provider-component-os-support)
+ [要件](#pkcs11-provider-component-requirements)
+ [依存関係](#pkcs11-provider-component-dependencies)
+ [設定](#pkcs11-provider-component-configuration)
+ [ローカルログファイル](#pkcs11-provider-component-log-file)
+ [変更ログ](#pkcs11-provider-component-changelog)

## バージョン
<a name="pkcs11-provider-component-versions"></a>

このコンポーネントには、次のバージョンがあります。
+ 2.0.x

## タイプ
<a name="pkcs11-provider-component-type"></a>

<a name="public-component-type-plugin-para1"></a>このコンポーネントはプラグインコンポーネント (`aws.greengrass.plugin`) です。[Greengrass nucleus](greengrass-nucleus-component.md) は、nucleus と同じ Java バーチャルマシン (JVM) でこのコンポーネントを実行します。コアデバイスでこのコンポーネントのバージョンを変更するとき、nucleus が再起動します。

<a name="public-component-type-plugin-para2"></a>このコンポーネントは、Greengrass nucleus と同じログファイルを使用します。詳細については、「[AWS IoT Greengrass ログのモニタリング](monitor-logs.md)」を参照してください。

<a name="public-component-type-more-information"></a>詳細については、「[コンポーネントタイプ](develop-greengrass-components.md#component-types)」を参照してください。

## オペレーティングシステム
<a name="pkcs11-provider-component-os-support"></a>

このコンポーネントは、Linux コアデバイスにのみインストールできます。

## 要件
<a name="pkcs11-provider-component-requirements"></a>

このコンポーネントには次の要件があります。
+ <a name="hardware-security-module-requirements-key"></a>[PKCS\$11 v1.5](https://tools.ietf.org/html/rfc2313) 署名スキームと RSA-2048 キーサイズ (またはそれ以上の規模) または ECC キーを備えた RSA キーをサポートするハードウェアセキュリティモジュール。
**注記**  <a name="hardware-security-module-requirements-key-notes"></a>
ECC キーを備えたハードウェアセキュリティモジュールを使用するには、v2.5.6 以降の [Greengrass nucleus](greengrass-nucleus-component.md) を使用する必要があります。  
ハードウェアセキュリティモジュールと[シークレットマネージャー](secret-manager-component.md)を使用するには、RSA キーを備えたハードウェアセキュリティモジュールを使用する必要があります。
+ <a name="hardware-security-module-requirements-pkcs11-provider-library"></a> AWS IoT Greengrass Core ソフトウェアが実行時に (libdl を使用して) PKCS\$111 関数を呼び出すためにロードできる PKCS\$111 プロバイダーライブラリ。PKCS\$111 プロバイダライブラリは、次の PKCS\$111 API オペレーションを実装する必要があります。
  + `C_Initialize`
  + `C_Finalize`
  + `C_GetSlotList`
  + `C_GetSlotInfo`
  + `C_GetTokenInfo`
  + `C_OpenSession`
  + `C_GetSessionInfo`
  + `C_CloseSession`
  + `C_Login`
  + `C_Logout`
  + `C_GetAttributeValue`
  + `C_FindObjectsInit`
  + `C_FindObjects`
  + `C_FindObjectsFinal`
  + `C_DecryptInit`
  + `C_Decrypt`
  + `C_DecryptUpdate`
  + `C_DecryptFinal`
  + `C_SignInit`
  + `C_Sign`
  + `C_SignUpdate`
  + `C_SignFinal`
  + `C_GetMechanismList`
  + `C_GetMechanismInfo`
  + `C_GetInfo`
  + `C_GetFunctionList`
+ <a name="hardware-security-module-requirements-slot-label"></a>ハードウェアモジュールは、「PKCS\$111 仕様」で定義されているスロットラベルで解決できる必要があります。
+ <a name="hardware-security-module-requirements-private-key-and-certificate"></a>プライベートキーと証明書は HSM の同じスロットに保存する必要があり、HSM がオブジェクト ID をサポートしている場合、同じオブジェクトラベルとオブジェクト ID を使用する必要があります。
+ <a name="hardware-security-module-requirements-object-label"></a>証明書とプライベートキーがオブジェクトラベルで解決できる必要があります。
+ <a name="hardware-security-module-requirements-private-key-permissions"></a>プライベートキーには、次の許可が必要です。
  + `sign`
  + `decrypt`
+ <a name="hardware-security-module-requirements-secret-manager-permissions"></a>(オプション) [シークレットマネージャーコンポーネント](secret-manager-component.md)を使用する場合、バージョン 2.1.0 以降を使用する必要があります。また、プライベートキーには次の許可が必要です。
  + `unwrap`
  + `wrap`
+ <a name="hardware-security-module-requirements-environment-variable"></a>(オプション) TPM2 ライブラリを使用し、Greengrass コアをサービスとして実行している場合は、環境変数に PKCS\$111 ストアの場所を指定する必要があります。次の例は、必要な環境変数を含む systemd サービスファイルです。

  ```
  [Unit]
  Description=Greengrass Core
  After=network.target
  
  [Service]
  Type=simple
  PIDFile=/var/run/greengrass.pid
  Environment=TPM2_PKCS11_STORE=/path/to/store/directory
  RemainAfterExit=no
  Restart=on-failure
  RestartSec=10
  ExecStart=/bin/sh /greengrass/v2/alts/current/distro/bin/loader
  
  [Install]
  WantedBy=multi-user.target
  ```

## 依存関係
<a name="pkcs11-provider-component-dependencies"></a>

コンポーネントをデプロイすると、 は互換性のあるバージョンの依存関係 AWS IoT Greengrass もデプロイします。つまり、コンポーネントを正常にデプロイするには、コンポーネントとその依存関係のすべての要件を満たす必要があります。このセクションでは、このコンポーネントの[リリースされたバージョン](#pkcs11-provider-component-changelog)の依存関係と、各依存関係に対するコンポーネントのバージョンを定義するセマンティックバージョン制約をリスト表示しています。コンポーネントの各バージョンの依存関係は、[AWS IoT Greengrass コンソール](https://console.aws.amazon.com//greengrass)でも確認できます。コンポーネントの詳細ページで **[Dependencies]** (依存関係) リストを確認します。

------
#### [ 2.0.11 ]

次の表に、このコンポーネントのバージョン 2.0.11 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.17.0 | ソフト | 

------
#### [ 2.0.10 ]

次の表に、このコンポーネントのバージョン 2.0.10 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.16.0  | ソフト | 

------
#### [ 2.0.9 ]

次の表に、このコンポーネントのバージョン 2.0.9 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.15.0  | ソフト | 

------
#### [ 2.0.8 ]

次の表に、このコンポーネントのバージョン 2.0.8 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.14.0  | ソフト | 

------
#### [ 2.0.7 ]

次の表に、このコンポーネントのバージョン 2.0.7 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.13.0  | ソフト | 

------
#### [ 2.0.6 ]

次の表に、このコンポーネントのバージョン 2.0.6 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.12.0  | ソフト | 

------
#### [ 2.0.5 ]

次の表に、このコンポーネントのバージョン 2.0.5 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.11.0  | ソフト | 

------
#### [ 2.0.4 ]

次の表に、このコンポーネントのバージョン 2.0.4 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.10.0  | ソフト | 

------
#### [ 2.0.3 ]

次の表に、このコンポーネントのバージョン 2.0.3 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.9.0  | ソフト | 

------
#### [ 2.0.2 ]

次の表に、このコンポーネントのバージョン 2.0.2 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.5.3 <2.8.0  | ソフト | 

------
#### [ 2.0.1 ]

次の表に、このコンポーネントのバージョン 2.0.1 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.5.3 <2.7.0  | ソフト | 

------
#### [ 2.0.0 ]

次の表に、このコンポーネントのバージョン 2.0.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) |  >=2.5.3 <2.6.0  | ソフト | 

------

コンポーネントの依存関係の詳細については、「[コンポーネント recipe のリファレンス](component-recipe-reference.md#recipe-reference-component-dependencies)」を参照してください。

## 設定
<a name="pkcs11-provider-component-configuration"></a>

このコンポーネントには、コンポーネントのデプロイ時にカスタマイズできる次の設定パラメータが用意されています。<a name="pkcs11-provider-component-configuration-parameters"></a>

`name`  
PKCS\$111 設定の名前。

`library`  
 AWS IoT Greengrass Core ソフトウェアが libdl でロードできる PKCS\$111 実装のライブラリへの絶対ファイルパス。

`slot`  
プライベートキーとデバイス証明書を含むスロットの ID。この値は、スロットインデックスやスロットラベルとは異なります。

`userPin`  
スロットへのアクセスに使用するユーザー PIN。

**Example 例: 設定マージの更新**  

```
{
  "name": "softhsm_pkcs11",
  "library": "/usr/lib/softhsm/libsofthsm2.so",
  "slot": 1,
  "userPin": "1234"
}
```

## ローカルログファイル
<a name="pkcs11-provider-component-log-file"></a>

このコンポーネントは、[Greengrass nucleus](greengrass-nucleus-component.md) コンポーネントと同じログファイルを使用します。

------
#### [ Linux ]

```
/greengrass/v2/logs/greengrass.log
```

------
#### [ Windows ]

```
C:\greengrass\v2\logs\greengrass.log
```

------

**このコンポーネントのログを確認するには**
+ コアデバイスに次のコマンドを実行して、このコンポーネントのログファイルをリアルタイムに確認します。`/greengrass/v2` または *C:\$1greengrass\$1v2* を AWS IoT Greengrass ルートフォルダへのパスに置き換えます。

------
#### [ Linux ]

  ```
  sudo tail -f /greengrass/v2/logs/greengrass.log
  ```

------
#### [ Windows (PowerShell) ]

  ```
  Get-Content C:\greengrass\v2\logs\greengrass.log -Tail 10 -Wait
  ```

------

## 変更ログ
<a name="pkcs11-provider-component-changelog"></a>

次の表は、コンポーネントの各バージョンにおける変更を示します。


|  **バージョン**  |  **変更**  | 
| --- | --- | 
|  2.0.12  |  Greengrass nucleus バージョン 2.17.0 リリースのコンポーネントバージョンを更新します。  | 
|  2.0.11  |  Greengrass nucleus バージョン 2.16.0 リリース用にバージョンが更新されました。  | 
|  2.0.10  | Greengrass nucleus バージョン 2.15.0 のリリース用にバージョンが更新されました。 | 
|  2.0.9  | Greengrass nucleus バージョン 2.14.0 のリリース用にバージョンが更新されました。 | 
|  2.0.8  | Greengrass nucleus バージョン 2.13.0 のリリース用にバージョンが更新されました。 | 
|  2.0.7  | Greengrass nucleus バージョン 2.12.0 のリリース用にバージョンが更新されました。 | 
|  2.0.6  | Greengrass nucleus バージョン 2.11.0 のリリース用にバージョンが更新されました。 | 
|  2.0.5  | Greengrass nucleus バージョン 2.10.0 のリリース用にバージョンが更新されました。 | 
|  2.0.4  | Greengrass nucleus バージョン 2.9.0 のリリース用にバージョンが更新されました。 | 
|  2.0.3  | Greengrass nucleus バージョン 2.8.0 のリリース用にバージョンが更新されました。 | 
|  2.0.2  |  Greengrass nucleus バージョン 2.7.0 のリリース用にバージョンが更新されました。  | 
|  2.0.1  |  Greengrass nucleus バージョン 2.6.0 のリリース用にバージョンが更新されました。  | 
|  2.0.0  |  当初のバージョン  | 