翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
クラウドで対称AESキーを生成するHSM CLI
クラウドHSMの key generate-symmetric aes コマンドを使用してCLI、 AWS CloudHSM クラスターに対称AESキーを生成します。
ユーザーのタイプ
このコマンドは、次のタイプのユーザーが実行できます。
-
Crypto ユーザー (CUs)
要件
このコマンドを実行するには、CU としてログインする必要があります。
構文
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 ユーザーが含まれます。キーを共有する最小ユーザー数を決定するには、キー使用クォーラム値とキー管理クォーラム値の間の最大のクォーラム値を取得し、キー所有者を考慮して 1 を減算します。キー所有者はデフォルトでキーに関連付けられています。より多くのユーザーとキーを共有するには、 クラウドを使用してキーを共有するHSM 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>
-
生成したキーに設定するAESキー属性のスペース区切りリストを の形式で指定します
KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE
(例:sign=true
)。サポートされているキー属性のリストについては、「クラウドの主要な属性HSM CLI」を参照してください。
必須: いいえ
<KEY-LENGTH-BYTES>
-
キーの長さをバイト単位で指定します。
有効な値:
16、24、32
必須: はい
<LABEL>
-
AES キーのユーザー定義ラベルを指定します。で使用できる最大サイズ
label
は、クライアント 5.11 以降では 127 SDK 文字です。クライアント SDK 5.10 以前では、126 文字に制限されています。必須: はい
<SESSION>
-
現在のセッションにのみ存在するキーを作成します。セッション終了後、キーをリカバリすることはできません。
このパラメータは、別のキーを暗号化してからすばやく復号化するラッピングキーなど、キーが短時間だけ必要な場合に使用します。セッション終了後に復号する必要がある可能性のあるデータを暗号化するためにセッションキーを使用しないでください。
デフォルトでは、生成されるキーは永続 (トークン) キーです。<SESSION> を渡すと変更され、この引数で生成されたキーがセッション (エフェメラル) キーになります。
必須: いいえ
<SHARE_CRYPTO_USERS>
-
AES キーを共有する Crypto User ユーザー名のスペース区切りリストを指定します。
必須: いいえ
<MANAGE_KEY_QUORUM_VALUE>
-
キー管理オペレーションのクォーラム値。この値は、キーが関連付けられているユーザーの数以下である必要があります。これには、キーが共有されているユーザーとキー所有者が含まれます。最大値は 8 です。
必須: いいえ
<USE_KEY_QUORUM_VALUE>
-
キー使用オペレーションのクォーラム値。この値は、キーが関連付けられているユーザーの数以下である必要があります。これには、キーが共有されているユーザーとキー所有者が含まれます。最大値は 8 です。
必須: いいえ