key generate-symmetric generic-secret - AWS CloudHSM

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

key generate-symmetric generic-secret

key generate-asymmetric-pair コマンドは、AWS CloudHSM クラスターに対称汎用シークレットキーを生成します。

ユーザーのタイプ

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

  • Crypto User (CU)

要件

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

構文

aws-cloudhsm > key help generate-symmetric generic-secret Generate a generic secret key Usage: key generate-symmetric generic-secret [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 generic secret key in the form of KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE -h, --help Print help

次の例は、key generate-symmetric generic-secret コマンドを使って汎用シークレットキーを作成する方法を示しています。

例: 汎用シークレットキー作成
aws-cloudhsm > key generate-symmetric generic-secret \ --label example-generic-secret \ --key-length-bytes 256 { "error_code": 0, "data": { "key": { "key-reference": "0x00000000002e08fd", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "session" }, "attributes": { "key-type": "generic-secret", "label": "example-generic-secret", "id": "", "class": "secret-key", "encrypt": false, "decrypt": false, "token": false, "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": 256 } } } }
例: オプションの属性を持つ汎用シークレットキー作成
aws-cloudhsm > key generate-symmetric generic-secret \ --label example-generic-secret \ --key-length-bytes 256 \ --attributes token=true encrypt=true { "error_code": 0, "data": { "key": { "key-reference": "0x00000000002e08fd", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "session" }, "attributes": { "key-type": "generic-secret", "label": "example-generic-secret", "id": "", "class": "secret-key", "encrypt": true, "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": 256 } } } }

引数

<CLUSTER_ID>

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

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

<KEY_ATTRIBUTES>

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

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

必須: いいえ

<KEY-LENGTH-BYTES>

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

有効値:

  • 1~800

必須: はい

<LABEL>

汎用シークレットキーのユーザー定義ラベルを指定します。で使用できる最大サイズlabelは、クライアント SDK 5.11 以降では 127 文字です。Client SDK 5.10 以前では、126 文字に制限されています。

必須: はい

<SESSION>

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

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

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

必須: いいえ

関連トピック