资源密钥哈希
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源密钥哈希值是一种机制,可让 Google 验证
封装的加密密钥,而无需访问密钥。
生成资源密钥哈希需要访问解封装的密钥,包括
密钥期间指定的 DEK、resource_name
和 perimeter_id
封装操作。
我们使用加密函数 HMAC-SHA256,将 unwrapped_dek
作为密钥,
将元数据串联为数据
("ResourceKeyDigest:", resource_name, ":", perimeter_id)
。
resource_name
和 perimeter_id
应为 UTF-8 编码字符串。
例如,当 resource_name = "my_resource"
时,
perimeter_id = "my_perimeter"
和 unwrapped_dek = 0xf00d
,资源密钥
值为:
echo -n "ResourceKeyDigest:my_resource:my_perimeter" | openssl sha256 -mac HMAC -macopt hexkey:f00d -binary
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],["The core mechanism is generating a resource key hash to verify wrapped encryption key integrity. This involves using HMAC-SHA256 with the unwrapped DEK as the key and a specific concatenation of metadata as data. The metadata consists of \"ResourceKeyDigest:\", the UTF-8 encoded `resource_name`, \":\", and the UTF-8 encoded `perimeter_id`. An example shows generating the hash using `openssl` with a sample `resource_name`, `perimeter_id`, and `unwrapped_dek`.\n"],null,[]]