密钥解包 rsa-aes - AWS CloudHSM

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

密钥解包 rsa-aes

key unwrap rsa-aes命令使用 RSA 私钥和解包机制解封有效载荷密钥。RSA-AES

未封装的密钥的使用方式与生成的 AWS CloudHSM密钥相同。为了表示它们不是在本地生成的,它们的local属性设置为false

要使用key unwrap rsa-aes,您的 AWS CloudHSM 集群中必须有 RSA 公用包装密钥的 RSA 私钥,并且其unwrap属性必须设置为。true

用户类型

以下类型的用户均可运行此命令。

  • 加密用户(CU)

要求

  • 要运行此命令,必须以 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 --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

示例

这些示例说明如何使用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": [], "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": [], "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-secret、、rsa-private]。

必需:是

<HASH_FUNCTION>

指定哈希函数。

有效值:

  • sha1

  • sha224

  • sha256

  • sha384

  • sha512

必需:是

<MGF>

指定蒙版生成函数。

注意

掩码生成函数哈希函数必须与签名机制哈希函数相匹配。

有效值:

  • mgf1-sha1

  • mgf1-sha224

  • mgf1-sha256

  • mgf1-sha384

  • mgf1-sha512

必需:是

<LABEL>

未包装的密钥的标签。

必需:是

<SESSION>

创建仅存在于当前会话中的会话密钥。会话结束后,密钥无法恢复。

必需:否

相关 主题