You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="firstline">Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.</p>
<pclass="firstline">Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.</p>
<pclass="firstline">Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.</p>
<pre>Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.
529
+
530
+
Args:
531
+
name: string, Required. The resource name of the CryptoKeyVersion to use for signing. (required)
532
+
body: object, The request body.
533
+
The object takes the form of:
534
+
535
+
{ # Request message for KeyManagementService.MacSign.
536
+
"data": "A String", # Required. The data to sign. The MAC tag is computed over this data field based on the specific algorithm.
537
+
"dataCrc32c": "A String", # Optional. An optional CRC32C checksum of the MacSignRequest.data. If specified, KeyManagementService will verify the integrity of the received MacSignRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacSignRequest.data) is equal to MacSignRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
538
+
}
539
+
540
+
x__xgafv: string, V1 error format.
541
+
Allowed values
542
+
1 - v1 error format
543
+
2 - v2 error format
544
+
545
+
Returns:
546
+
An object of the form:
547
+
548
+
{ # Response message for KeyManagementService.MacSign.
549
+
"mac": "A String", # The created signature.
550
+
"macCrc32c": "A String", # Integrity verification field. A CRC32C checksum of the returned MacSignResponse.mac. An integrity check of MacSignResponse.mac can be performed by computing the CRC32C checksum of MacSignResponse.mac and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
551
+
"name": "A String", # The resource name of the CryptoKeyVersion used for signing. Check this field to verify that the intended resource was used for signing.
552
+
"protectionLevel": "A String", # The ProtectionLevel of the CryptoKeyVersion used for signing.
553
+
"verifiedDataCrc32c": True or False, # Integrity verification field. A flag indicating whether MacSignRequest.data_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacSignRequest.data_crc32c was left unset or that it was not delivered to KeyManagementService. If you've set MacSignRequest.data_crc32c but this field is still false, discard the response and perform a limited number of retries.
<pre>Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.
560
+
561
+
Args:
562
+
name: string, Required. The resource name of the CryptoKeyVersion to use for verification. (required)
563
+
body: object, The request body.
564
+
The object takes the form of:
565
+
566
+
{ # Request message for KeyManagementService.MacVerify.
567
+
"data": "A String", # Required. The data used previously as a MacSignRequest.data to generate the MAC tag.
568
+
"dataCrc32c": "A String", # Optional. An optional CRC32C checksum of the MacVerifyRequest.data. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacVerifyRequest.data) is equal to MacVerifyRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
569
+
"mac": "A String", # Required. The signature to verify.
570
+
"macCrc32c": "A String", # Optional. An optional CRC32C checksum of the MacVerifyRequest.mac. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.mac using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacVerifyRequest.tag) is equal to MacVerifyRequest.mac_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
571
+
}
572
+
573
+
x__xgafv: string, V1 error format.
574
+
Allowed values
575
+
1 - v1 error format
576
+
2 - v2 error format
577
+
578
+
Returns:
579
+
An object of the form:
580
+
581
+
{ # Response message for KeyManagementService.MacVerify.
582
+
"name": "A String", # The resource name of the CryptoKeyVersion used for verification. Check this field to verify that the intended resource was used for verification.
583
+
"protectionLevel": "A String", # The ProtectionLevel of the CryptoKeyVersion used for verification.
584
+
"success": True or False, # This field indicates whether or not the verification operation for MacVerifyRequest.mac over MacVerifyRequest.data was successful.
585
+
"verifiedDataCrc32c": True or False, # Integrity verification field. A flag indicating whether MacVerifyRequest.data_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacVerifyRequest.data_crc32c was left unset or that it was not delivered to KeyManagementService. If you've set MacVerifyRequest.data_crc32c but this field is still false, discard the response and perform a limited number of retries.
586
+
"verifiedMacCrc32c": True or False, # Integrity verification field. A flag indicating whether MacVerifyRequest.mac_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacVerifyRequest.mac_crc32c was left unset or that it was not delivered to KeyManagementService. If you've set MacVerifyRequest.mac_crc32c but this field is still false, discard the response and perform a limited number of retries.
587
+
"verifiedSuccessIntegrity": True or False, # Integrity verification field. This value is used for the integrity verification of [MacVerifyResponse.success]. If the value of this field contradicts the value of [MacVerifyResponse.success], discard the response and perform a limited number of retries.
<pre>Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.
0 commit comments