本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 Cloud 以 AES-PKCS5-PAD 取消包裝金鑰HSM CLI
在 CloudHSM 中使用 key unwrap aes-pkcs5-pad命令CLI,使用包裝金鑰和AES-PKCS5-PAD
取消AES包裝機制來取消包裝承載金鑰。
未包裝金鑰的使用方式與 產生的金鑰相同 AWS CloudHSM。為了表示它們不是在本機產生,其local
屬性會設為 false
。
若要使用 key unwrap aes-pkcs5-pad命令,您必須在 AWS CloudHSM 叢集中具有AES包裝金鑰,且其unwrap
屬性必須設定為 true
。
使用者類型
下列類型的使用者可以執行此命令。
-
加密使用者 (CUs)
要求
-
若要執行此命令,必須以 CU 的身分登入。
語法
aws-cloudhsm >
help key unwrap aes-pkcs5-pad
Usage: key unwrap aes-pkcs5-pad [OPTIONS] --filter [
<FILTER>
...] --key-type-class<KEY_TYPE_CLASS>
--label<LABEL>
<--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 --share-crypto-users [<SHARE_CRYPTO_USERS;
...] Space separated list of Crypto User usernames to share the unwrapped key with --manage-key-quorum-value<MANAGE_KEY_QUORUM_VALUE;
The quorum value for key management operations for the unwrapped key --use-key-quorum-value<USE_KEY_QUORUM_VALUE;
The quorum value for key usage operations for the unwrapped key --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 --approval<APPROVAL>
Filepath of signed quorum token file to approve operation -h, --help Print help
範例
這些範例說明如何使用 unwrap
屬性值設為 的 AES金鑰來使用 key unwrap aes-pkcs5-pad命令true
。
範例:從 Base64 編碼的包裝金鑰資料中取消包裝承載金鑰
aws-cloudhsm >
key unwrap aes-pkcs5-pad --key-type-class aes --label aes-unwrapped --filter attr.label=aes-example --data MbuYNresfOKyGNnxKWen88nSfX+uUE/0qmGofSisicY=
{ "error_code": 0, "data": { "key": { "key-reference": "0x00000000001c08e3", "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": "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-pkcs5-pad --key-type-class aes --label aes-unwrapped --filter attr.label=aes-example --data-path payload-key.pem
{ "error_code": 0, "data": { "key": { "key-reference": "0x00000000001c08e3", "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": "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>
-
要執行此操作的叢集 ID。
必要:如果已設定多個叢集。
<FILTER>
-
索引鍵參考 (例如
key-reference=0xabc
) 或以 形式分隔的索引鍵屬性清單attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE
,以選取要取消包裝的索引鍵。必要:是
<DATA_PATH>
-
包含包裝金鑰資料的二進位檔案路徑。
必要:是 (除非透過 Base64 編碼資料提供)
<DATA>
-
Base64 編碼的包裝金鑰資料。
必要:是 (除非透過資料路徑提供)
<ATTRIBUTES>
-
以 的形式
KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE
為包裝金鑰以空格分隔的金鑰屬性清單。必要:否
<KEY_TYPE_CLASS>
-
封裝金鑰的金鑰類型和類別 【可能值:
aes
、des3
、ec-private
、generic-secret
、rsa-private
】。必要:是
<LABEL>
-
未包裝金鑰的標籤。
必要:是
<SESSION>
-
建立僅存在於目前工作階段的工作階段金鑰。工作階段結束後,金鑰無法復原。
必要:否
<APPROVAL>
-
指要核准操作的已簽署規定人數權杖檔案的檔案路徑。只有在未包裝金鑰的金鑰管理服務規定人數值大於 1 時才需要。