密鑰展開一個-gcm - AWS CloudHSM

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

密鑰展開一個-gcm

key unwrap aes-gcm命令使用 AES 包裝密鑰和解包機制將有效負載密鑰AES-GCM解開到集群中。

未包裝的金鑰可以使用與產生的金鑰相同的方式使用 AWS CloudHSM。若要指出它們不是在本機產生,其local屬性會設定為false

若要使用key unwrap aes-gcm命令,您必須在 AWS CloudHSM 叢集中有 AES 包裝金鑰,且其unwrap屬性必須設定為true

使用者類型

下列類型的使用者可以執行此命令。

  • 加密使用者 (CU)

要求

  • 若要執行此命令,必須以 CU 的身分登入。

語法

aws-cloudhsm > help key unwrap aes-gcm Usage: key unwrap aes-gcm [OPTIONS] --filter [<FILTER>...] --tag-length-bits <TAG_LENGTH_BITS> --key-type-class <KEY_TYPE_CLASS> --label <LABEL> --iv <IV> <--data-path <DATA_PATH>|--data <DATA>> 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 --filter [<FILTER>...] Key reference (e.g. key-reference=0xabc) or space separated list of key attributes in the form of attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE to select a key to unwrap with --data-path <DATA_PATH> Path to the binary file containing the wrapped key data --data <DATA> Base64 encoded wrapped key data --attributes [<UNWRAPPED_KEY_ATTRIBUTES>...] Space separated list of key attributes in the form of KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE for the unwrapped key --aad <AAD> Aes GCM Additional Authenticated Data (AAD) value, in hex --tag-length-bits <TAG_LENGTH_BITS> Aes GCM tag length in bits --key-type-class <KEY_TYPE_CLASS> Key type and class of wrapped key [possible values: aes, des3, ec-private, generic-secret, rsa-private] --label <LABEL> Label for the unwrapped key --session Creates a session key that exists only in the current session. The key cannot be recovered after the session ends --iv <IV> Initial value used to wrap the key, in hex -h, --help Print help

範例

這些範例說明如何使用 AES 金鑰並將unwrap屬性值設定為的key unwrap aes-gcm命令true

範例 示例:從 Base64 編碼的包裝密鑰數據中解開有效負載密鑰
aws-cloudhsm > key unwrap aes-gcm --key-type-class aes --label aes-unwrapped --filter attr.label=aes-example --tag-length-bits 64 --aad 0x10 --iv 0xf90613bb8e337ec0339aad21 --data xvslgrtg8kHzrvekny97tLSIeokpPwV8 { "error_code": 0, "data": { "key": { "key-reference": "0x00000000001808e4", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "aes-unwrapped", "id": "0x", "check-value": "0x8d9099", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": false, "derive": false, "destroyable": true, "extractable": true, "local": false, "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": 16 } } } }
範例:解除包裝透過資料路徑提供的裝載金鑰
aws-cloudhsm > key unwrap aes-gcm --key-type-class aes --label aes-unwrapped --filter attr.label=aes-example --tag-length-bits 64 --aad 0x10 --iv 0xf90613bb8e337ec0339aad21 --data-path payload-key.pem { "error_code": 0, "data": { "key": { "key-reference": "0x00000000001808e4", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "aes-unwrapped", "id": "0x", "check-value": "0x8d9099", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": false, "derive": false, "destroyable": true, "extractable": true, "local": false, "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": 16 } } } }

引數

<CLUSTER_ID>

執行此作業的叢集識別碼。

必要:如果已設定多個叢集。

<FILTER>

鍵引用(例如,key-reference=0xabc)或空格分隔的鍵屬性列表,attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE以選擇要解包的鍵的形式。

必要:是

<DATA_PATH>

包含包裝金鑰資料之二進位檔案的路徑。

必要:是 (除非透過 Base64 編碼資料提供)

<DATA>

以 Base64 編碼包裝的金鑰資料。

必要:是 (除非透過資料路徑提供)

<ATTRIBUTES>

以包裝金鑰的形式,以空格分隔的KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE索引鍵屬性清單。

必要:否

<AAD>

Aes GCM 其他驗證資料 (AAD) 值,以十六進位表示。

必要:否

<TAG_LENGTH_BITS>

Aes GCM 標籤長度 (以位為單位)。

必要:是

<KEY_TYPE_CLASS>

包裝鍵的鍵類型和類別 [可能的值:aesdes3,ec-private,generic-secret,,rsa-private]。

必要:是

<LABEL>

未包裝金鑰的標籤。

必要:是

<SESSION>

建立只存在於目前工作階段中的工作階段金鑰。工作階段結束後,金鑰無法復原。

必要:否

<IV>

用來包裝金鑰的初始值,以十六進位表示。

必要:否

相關主題