资源密钥哈希
资源密钥哈希值是一种机制,可让 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):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["The resource key hash ensures Google can verify the integrity of wrapped encryption keys without needing access to the actual keys."],["Generating the hash requires the unwrapped key, resource name, and perimeter ID used during key wrapping."],["It utilizes HMAC-SHA256, using the unwrapped key as the key and a concatenation of resource details as data for the hash calculation."],["The resource name and perimeter ID need to be UTF-8 encoded strings for the hash generation."]]],[]]