CloudHSM CLI で対称 AES キーを生成する - AWS CloudHSM

CloudHSM CLI で対称 AES キーを生成する

CloudHSM CLI の key generate-symmetric aes コマンドを使用して、AWS CloudHSM クラスターに対称 AES キーを生成します。

ユーザータイプ

このコマンドは、次のタイプのユーザーが実行できます。

  • Crypto User (CU)

要件

このコマンドを実行するには、CU としてログインする必要があります。

Syntax

aws-cloudhsm > help key generate-symmetric aes Generate an AES key Usage: key generate-symmetric aes [OPTIONS] --label <LABEL> --key-length-bytes <KEY_LENGTH_BYTES> Options: --cluster-id <CLUSTER_ID> Unique Id to choose which of the clusters in the config file to run the operation against. If not provided, will fall back to the value provided when interactive mode was started, or error --label <LABEL> Label for the key --session Creates a session key that exists only in the current session. The key cannot be recovered after the session ends --key-length-bytes <KEY_LENGTH_BYTES> Key length in bytes --attributes [<KEY_ATTRIBUTES>...] Space separated list of key attributes to set for the generated AES key in the form of KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE --share-crypto-users [<SHARE_CRYPTO_USERS>...] Space separated list of Crypto User usernames to share the AES key with --manage-key-quorum-value <MANAGE_KEY_QUORUM_VALUE> The quorum value for key management operations --use-key-quorum-value <USE_KEY_QUORUM_VALUE> The quorum value for key usage operations -h, --help Print help

以下の例では、key generate-symmetric aes コマンドを使って AES キーを作成する方法を示します。

例: AES キーの作成
aws-cloudhsm > key generate-symmetric aes \ --label example-aes \ --key-length-bytes 24 { "error_code": 0, "data": { "key": { "key-reference": "0x00000000002e06bf", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "key-quorum-values": { "manage-key-quorum-value": 0, "use-key-quorum-value": 0 }, "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "example-aes", "id": "", "check-value": "0x9b94bd", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 24 } } } }
例: オプションの属性を含む AES キーペアの作成
aws-cloudhsm > key generate-symmetric aes \ --label example-aes \ --key-length-bytes 24 \ --attributes decrypt=true encrypt=true { "error_code": 0, "data": { "key": { "key-reference": "0x00000000002e06bf", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "key-quorum-values": { "manage-key-quorum-value": 0, "use-key-quorum-value": 0 }, "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "example-aes", "id": "", "check-value": "0x9b94bd", "class": "secret-key", "encrypt": true, "decrypt": true, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 24 } } } }
例: クォーラム値を含む AES キーの作成

クォーラム制御を使用してキーを生成する場合、キーには、キーの最大クォーラム値と同じ数以上のユーザーを関連付ける必要があります。関連付けられるユーザーには、キー所有者と、そのキーが共有されている Crypto User が含まれます。キーを共有すべき最小ユーザー数を決定するには、キー使用クォーラム値とキー管理クォーラム値のうち大きい方のクォーラム値を取得し、デフォルトでキーに関連付けられているキー所有者を考慮して 1 を差し引きます。キーをさらに多くのユーザーと共有するには、CloudHSM CLI を使用してキーを共有する コマンドを使用します。

aws-cloudhsm > key generate-symmetric aes \ --label example-aes \ --key-length-bytes 24 \ --attributes decrypt=true encrypt=true --share-crypto-users cu2 cu3 cu4 \ --manage-key-quorum-value 4 \ --use-key-quorum-value 2 { "error_code": 0, "data": { "key": { "key-reference": "0x00000000002e06bf", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [ { "username": "cu2", "key-coverage": "full" }, { "username": "cu3", "key-coverage": "full" }, { "username": "cu4", "key-coverage": "full" }, ], "key-quorum-values": { "manage-key-quorum-value": 4, "use-key-quorum-value": 2 }, "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "example-aes", "id": "", "check-value": "0x9b94bd", "class": "secret-key", "encrypt": true, "decrypt": true, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 24 } } } }

引数

<CLUSTER_ID>

このオペレーションを実行するクラスターの ID。

必須: 複数のクラスターが設定されている場合。

<KEY_ATTRIBUTES>

KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE 形式で生成された AES キーに設定するキー属性のスペース区切りリストを指定します (例: sign=true)。

サポートされているキー属性のリストについては、「CloudHSM CLI のキー属性」を参照してください。

必須: いいえ

<KEY-LENGTH-BYTES>

キーの長さをバイト単位で指定します。

有効な値:

  • 16、24、32

必須: はい

<LABEL>

AES キーのユーザー定義ラベルを指定します。label に許可される最大サイズは、クライアント SDK 5.11 以降では 127 文字です。クライアント SDK 5.10 以前では、制限は 126 文字です。

必須: はい

<SESSION>

現在のセッションにのみ存在するキーを作成します。セッション終了後、キーをリカバリすることはできません。

このパラメータは、別のキーを暗号化してからすばやく復号化するラッピングキーなど、キーが短時間だけ必要な場合に使用します。セッション終了後に復号する必要がある可能性のあるデータを暗号化するためにセッションキーを使用しないでください。

デフォルトでは、生成されるキーは永続 (トークン) キーです。<SESSION> で渡すことでこれが変わり、この引数で生成されたキーがセッション (エフェメラル) キーであることが保証されます。

必須: いいえ

<SHARE_CRYPTO_USERS>

AES キーを共有する Crypto User ユーザー名のスペース区切りリストを指定します。

必須: いいえ

<MANAGE_KEY_QUORUM_VALUE>

キー管理オペレーションのクォーラム値。この値は、キーが関連付けられているユーザーの数以下である必要があります。これには、そのキーが共有されているユーザーと、キー所有者が含まれます。最大値は 8 です。

必須: いいえ

<USE_KEY_QUORUM_VALUE>

キー使用オペレーションのクォーラム値。この値は、キーが関連付けられているユーザーの数以下である必要があります。これには、そのキーが共有されているユーザーと、キー所有者が含まれます。最大値は 8 です。

必須: いいえ

関連トピック