Represents the metadata for a Google Cloud Storage HmacKeyResource.
HMAC keys allow applications to authenticate with Google Cloud Storage using HMAC authentication. Applications can create a limited number of HMAC keys associated with a service account. The application can use the HMAC keys to authenticate with GCS. GCS will use the service account permissions to determine if the request is authorized.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe document details the \u003ccode\u003eHmacKeyMetadata\u003c/code\u003e class, which represents metadata for a Google Cloud Storage HMAC key resource, essential for applications authenticating with Google Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eIt provides a list of available versions, ranging from the latest release candidate \u003ccode\u003e2.37.0-rc\u003c/code\u003e down to version \u003ccode\u003e2.11.0\u003c/code\u003e, each linking to its corresponding documentation for the \u003ccode\u003eHmacKeyMetadata\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHmacKeyMetadata\u003c/code\u003e class includes functions for setting and retrieving various metadata attributes, such as \u003ccode\u003eaccess_id\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eproject_id\u003c/code\u003e, \u003ccode\u003eservice_account_email\u003c/code\u003e, \u003ccode\u003etime_created\u003c/code\u003e, \u003ccode\u003eupdated\u003c/code\u003e, and \u003ccode\u003eetag\u003c/code\u003e, as well as \u003ccode\u003estate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTesting modifiers are included in the functions for attributes that cannot normally be changed during updating, creating, or patching an \u003ccode\u003eHmacKeyMetadata\u003c/code\u003e resource, but are required when mocking the C++ client library test results.\u003c/p\u003e\n"],["\u003cp\u003eStatic functions are provided to easily retrieve the possible states of an HMAC key (\u003ccode\u003estate_active\u003c/code\u003e, \u003ccode\u003estate_inactive\u003c/code\u003e, and \u003ccode\u003estate_deleted\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# Class HmacKeyMetadata (2.42.0-rc)\n\nVersion latestkeyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.41.0](/cpp/docs/reference/storage/2.41.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.40.0](/cpp/docs/reference/storage/2.40.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.39.0](/cpp/docs/reference/storage/2.39.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.38.0](/cpp/docs/reference/storage/2.38.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.37.0](/cpp/docs/reference/storage/2.37.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.36.0](/cpp/docs/reference/storage/2.36.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.35.0](/cpp/docs/reference/storage/2.35.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.34.0](/cpp/docs/reference/storage/2.34.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.33.0](/cpp/docs/reference/storage/2.33.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.32.0](/cpp/docs/reference/storage/2.32.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.31.0](/cpp/docs/reference/storage/2.31.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.30.0](/cpp/docs/reference/storage/2.30.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.29.0](/cpp/docs/reference/storage/2.29.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.28.0](/cpp/docs/reference/storage/2.28.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.27.0](/cpp/docs/reference/storage/2.27.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.26.0](/cpp/docs/reference/storage/2.26.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.25.1](/cpp/docs/reference/storage/2.25.1/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.24.0](/cpp/docs/reference/storage/2.24.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.23.0](/cpp/docs/reference/storage/2.23.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.22.1](/cpp/docs/reference/storage/2.22.1/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.21.0](/cpp/docs/reference/storage/2.21.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.20.0](/cpp/docs/reference/storage/2.20.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.19.0](/cpp/docs/reference/storage/2.19.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.18.0](/cpp/docs/reference/storage/2.18.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.17.0](/cpp/docs/reference/storage/2.17.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.16.0](/cpp/docs/reference/storage/2.16.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.15.1](/cpp/docs/reference/storage/2.15.1/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.14.0](/cpp/docs/reference/storage/2.14.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.13.0](/cpp/docs/reference/storage/2.13.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.12.0](/cpp/docs/reference/storage/2.12.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata)\n- [2.11.0](/cpp/docs/reference/storage/2.11.0/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) \nRepresents the metadata for a Google Cloud Storage HmacKeyResource. \nHMAC keys allow applications to authenticate with Google Cloud Storage using HMAC authentication. Applications can create a limited number of HMAC keys associated with a service account. The application can use the HMAC keys to authenticate with GCS. GCS will use the service account permissions to determine if the request is authorized.\n\n###### See Also\n\n\u003chttps://cloud.google.com/storage/docs/authentication/hmackeys\u003e for general information on HMAC keys.\n\n###### See Also\n\n\u003chttps://cloud.google.com/storage/\u003e for general information on Google Cloud Storage.\n\nConstructors\n------------\n\n### HmacKeyMetadata()\n\nFunctions\n---------\n\n### set_access_id(std::string)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_id(std::string)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_kind(std::string)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_project_id(std::string)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_service_account_email(std::string)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_time_created(std::chrono::system_clock::time_point)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### set_updated(std::chrono::system_clock::time_point)\n\nTesting modifiers. \nThe following attributes cannot be changed when updating, creating, or patching an [HmacKeyMetadata](/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1HmacKeyMetadata) resource.\n\nHowever, it is useful to change them in tests, e.g., when mocking the results from the C++ client library.\n\n### access_id() const\n\n### etag() const\n\n### set_etag(std::string)\n\n### id() const\n\n### kind() const\n\n### project_id() const\n\n### service_account_email() const\n\n### state() const\n\n### set_state(std::string)\n\n### time_created() const\n\n### updated() const\n\n### static state_active()\n\n### static state_inactive()\n\n### static state_deleted()"]]