密鑰解開 RSA-工作 - AWS CloudHSM

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

密鑰解開 RSA-工作

key unwrap rsa-oaep命令使用 RSA 私鑰和解包機制RSA-OAEP解包裝有效負載密鑰。

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

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

使用者類型

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

  • 加密使用者 (CU)

要求

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

語法

aws-cloudhsm > help key unwrap rsa-oaep Usage: key unwrap rsa-oaep [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 --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 -h, --help Print help

範例

這些範例說明如何使用 RSA 私密金鑰且unwrap屬性值設定為truekey unwrap rsa-oaep命令。

範例 示例:從 Base64 編碼的包裝密鑰數據中解開有效負載密鑰
aws-cloudhsm > key unwrap rsa-oaep --key-type-class aes --label aes-unwrapped --filter attr.label=rsa-private-example-key --hash-function sha256 --mgf mgf1-sha256 --data OjJe4msobPLz9TuSAdULEu17T5rMDWtSlLyBSkLbaZnYzzpdrhsbGLbwZJCtB/jGkDNdB4qyTAOQwEpggGf6v+Yx6JcesNeKKNU8XZal/YBoHC8noTGUSDI2qr+u2tDc84NPv6d+F2KOONXsSxMhmxzzNG/gzTVIJhOuy/B1yHjGP4mOXoDZf5+7f5M1CjxBmz4Vva/wrWHGCSG0yOaWblEvOiHAIt3UBdyKmU+/My4xjfJv7WGGu3DFUUIZ06TihRtKQhUYU1M9u6NPf9riJJfHsk6QCuSZ9yWThDT9as6i7e3htnyDhIhGWaoK8JU855cN/YNKAUqkNpC4FPL3iw== { "data": { "key": { "key-reference": "0x00000000001808e9", "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 rsa-oaep --key-type-class aes --label aes-unwrapped --filter attr.label=rsa-private-example-key --hash-function sha256 --mgf mgf1-sha256 --data-path payload-key.pem { "error_code": 0, "data": { "key": { "key-reference": "0x00000000001808e9", "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索引鍵屬性清單。

必要:否

<KEY_TYPE_CLASS>

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

必要:是

<HASH_FUNCTION>

指定哈希函數。

有效值:

  • sha1

  • sha224

  • sha256

  • sha384

  • sha512

必要:是

<MGF>

指定遮罩產生函數。

注意

掩碼生成函數哈希函數必須與簽名機制哈希函數匹配。

有效值:

  • 毫克 1 沙 1

  • 毫克 1-沙 224

  • 毫克 1-沙 256

  • 毫克 -1 沙 384

  • 毫克 1-沙 512

必要:是

<LABEL>

未包裝金鑰的標籤。

必要:是

<SESSION>

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

必要:否

相關主題