Verifying a MAC
Function
This API is used to verify a MAC.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/kms/verify-mac
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID. Constraints N/A Range The value returned by the IAM API is used, which contains 32 characters. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range Obtain the value by calling the IAM API for obtaining the user token. Default Value N/A |
Response Parameters
Status code: 200
Example Requests
{
"key_id" : "826314dd-1b5b-4037-b976-5f9b7a17df46",
"mac_algorithm" : "HMAC_SHA_256",
"message" : "ZmRzYQ==",
"mac" : "8549f9f5ef335184e23e6d477776f0fd338d02c59e48e52e8d81d158e2fc9262"
} Example Responses
Status code: 200
Request succeeded.
{
"mac_algorithm" : "HMAC_SHA_256",
"key_id" : "826314dd-1b5b-4037-b976-5f9b7a17df46",
"mac_valid" : false
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
Error Codes
See Error Codes.