使用 RSA- AES使用 Cloud 取消包裝金鑰HSM CLI - AWS CloudHSM

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

使用 RSA- AES使用 Cloud 取消包裝金鑰HSM CLI

在 CloudHSM 中使用 key unwrap rsa-aes命令CLI,使用RSA私有金鑰和取消包裝機制來RSA-AES取消包裝承載金鑰。

未包裝金鑰的使用方式與 產生的金鑰相同 AWS CloudHSM。為了表示它們不是在本機產生,其local屬性會設為 false

若要使用 key unwrap rsa-aes,您必須在 AWS CloudHSM 叢集中擁有RSA公有包裝金鑰的RSA私有金鑰,且其unwrap屬性必須設定為 true

使用者類型

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

  • 加密使用者 (CUs)

要求

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

語法

aws-cloudhsm > help key unwrap rsa-aes Usage: key unwrap rsa-aes [OPTIONS] --filter [<FILTER>...] --hash-function <HASH_FUNCTION> --mgf <MGF> --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 --hash-function <HASH_FUNCTION> Hash algorithm [possible values: sha1, sha224, sha256, sha384, sha512] --mgf <MGF> Mask Generation Function algorithm [possible values: mgf1-sha1, mgf1-sha224, mgf1-sha256, mgf1-sha384, mgf1-sha512] --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 屬性值設為 的RSA私有金鑰來使用 key unwrap rsa-aes命令true

範例:從 Base64 編碼的包裝金鑰資料中取消包裝承載金鑰
aws-cloudhsm > key unwrap rsa-aes --key-type-class aes --label aes-unwrapped --filter attr.label=rsa-private-key-example --hash-function sha256 --mgf mgf1-sha256 --data HrSE1DEyLjIeyGdPa9R+ebiqB5TIJGyamPker31ZebPwRA+NcerbAJO8DJ1lXPygZcI21vIFSZJuWMEiWpe1R9D/5WSYgxLVKex30xCFqebtEzxbKuv4DOmU4meSofqREYvtb3EoIKwjyxCMRQFgoyUCuP4y0f0eSv0k6rSJh4NuCsHptXZbtgNeRcR4botN7LlzkEIUcq4fVHaatCwd0J1QGKHKyRhkol+RL5WGXKe4nAboAkC5GO7veI5yHL1SaKlssSJtTL/CFpbSLsAFuYbv/NUCWwMY5mwyVTCSlw+HlgKK+5TH1MzBaSi8fpfyepLT8sHy2Q/VRl6ifb49p6m0KQFbRVvz/OWUd6l4d97BdgtaEz6ueg== { "error_code": 0, "data": { "key": { "key-reference": "0x00000000001808e2", "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 rsa-aes --key-type-class aes --label aes-unwrapped --filter attr.label=rsa-private-key-example --hash-function sha256 --mgf mgf1-sha256 --data-path payload-key.pem { "error_code": 0, "data": { "key": { "key-reference": "0x00000000001808e2", "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>

封裝金鑰的金鑰類型和類別 【可能值:aesdes3ec-privategeneric-secretrsa-private】。

必要:是

<HASH_FUNCTION>

指定雜湊函數。

有效值:

  • sha1

  • sha224

  • sha256

  • sha384

  • sha512

必要:是

<MGF>

指定遮罩產生函數。

注意

遮罩產生函數雜湊函數必須符合簽署機制雜湊函數。

有效值:

  • mgf1-sha1

  • mgf1-sha224

  • mgf1-sha256

  • mgf1-sha384

  • mgf1-sha512

必要:是

<LABEL>

未包裝金鑰的標籤。

必要:是

<SESSION>

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

必要:否

<APPROVAL>

指要核准操作的已簽署規定人數權杖檔案的檔案路徑。只有在未包裝金鑰的金鑰管理服務規定人數值大於 1 時才需要。

相關主題