All Products
Search
Document Center

Key Management Service:Verify

Last Updated:Mar 31, 2026

Verifies a digital signature created by an asymmetric key.

Usage notes

The total size of all request parameters, encoded using Protocol Buffers, must not exceed 3 MB. If the request body exceeds this limit, the server rejects the request with HTTP 413. For large messages, generate a digest locally and pass it as the Message parameter with MessageType set to DIGEST, or call the Sign or Verify operation for signing and verification.

For supported key specifications and signature algorithms, see Key types and specifications.

Request parameters

ParameterTypeRequiredExampleDescription
KeyIdstringYes1234abcd-12ab-34cd-56ef-12345678****The globally unique ID of the key. You can also specify an alias bound to the key.
AlgorithmstringYesRSAES_OAEP_SHA_256The signature algorithm. Valid values: RSA_PSS_SHA_256, RSA_PKCS1_SHA_256, ECDSA_SHA_256, SM2DSA. Must match the algorithm used when calling the Sign operation.
MessageTypestringYesRAWThe type of the message to verify. Valid values: RAW (default), DIGEST. When set to DIGEST, Key Management Service (KMS) does not process the message digest of the raw data — KMS directly uses a private key to sign data.
MessagebytesYesBinary dataThe message to verify. If MessageType is RAW, Key Management Service (KMS) applies the hash algorithm specified by Algorithm to generate a digest, then verifies the signature. If MessageType is DIGEST, pass a pre-computed digest of up to 32 bytes.
SignaturebytesYesBinary dataThe signature value to verify.

Response elements

ParameterTypeExampleDescription
ValuebooltrueIndicates whether the signature is valid. Valid values: true, false.
KeyIdstring1234abcd-12ab-34cd-56ef-12345678****The globally unique ID of the key used for verification. If you specified an alias, this field returns the ID of the key the alias is bound to.
AlgorithmstringRSAES_OAEP_SHA_256The signature algorithm.
MessageTypestringRAWThe message type.
RequestIdstring475f1620-b9d3-4d35-b5c6-3fbdd941423dThe request ID.

Error codes

For a list of error codes, see Service error codes.