संसाधन कुंजी हैश
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
संसाधन कुंजी हैश एक ऐसा तरीका है जो 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
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe resource key hash ensures Google can verify the integrity of wrapped encryption keys without needing access to the actual keys.\u003c/p\u003e\n"],["\u003cp\u003eGenerating the hash requires the unwrapped key, resource name, and perimeter ID used during key wrapping.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes HMAC-SHA256, using the unwrapped key as the key and a concatenation of resource details as data for the hash calculation.\u003c/p\u003e\n"],["\u003cp\u003eThe resource name and perimeter ID need to be UTF-8 encoded strings for the hash generation.\u003c/p\u003e\n"]]],["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,["# Resource key hash\n\nThe resource key hash is a mechanism allowing Google to verify the integrity of\nthe wrapped encryption keys without having access to the keys.\n\nGenerating the resource key hash requires access to the unwrapped key including\nthe DEK, the `resource_name` and the `perimeter_id` specified during the key\nwrapping operation.\n\nWe use the cryptographic function HMAC-SHA256 with `unwrapped_dek` as a key and\nthe concatenation of metadata as data\n`(\"ResourceKeyDigest:\", resource_name, \":\", perimeter_id)`.\nThe `resource_name` and `perimeter_id` should be UTF-8 encoded strings.\n\nFor example, when `resource_name = \"my_resource\"`,\n`perimeter_id = \"my_perimeter\"` and `unwrapped_dek = 0xf00d`, the resource key\nhash is: \n\n echo -n \"ResourceKeyDigest:my_resource:my_perimeter\" | openssl sha256 -mac HMAC -macopt hexkey:f00d -binary"]]