messageType

Tells KMS whether the value of the Message parameter should be hashed as part of the signing algorithm. Use RAW for unhashed messages; use DIGEST for message digests, which are already hashed; use EXTERNAL_MU for 64-byte representative μ used in ML-DSA signing as defined in NIST FIPS 204 Section 6.2.

When the value of MessageType is RAW, KMS uses the standard signing algorithm, which begins with a hash function. When the value is DIGEST, KMS skips the hashing step in the signing algorithm. When the value is EXTERNAL_MU KMS skips the concatenated hashing of the public key hash and the message done in the ML-DSA signing algorithm.

Use the DIGEST or EXTERNAL_MU value only when the value of the Message parameter is a message digest. If you use the DIGEST value with an unhashed message, the security of the signing operation can be compromised.

When the value of MessageType is DIGEST, the length of the Message value must match the length of hashed messages for the specified signing algorithm.

When the value of MessageType is EXTERNAL_MU the length of the Message value must be 64 bytes.

You can submit a message digest and omit the MessageType or specify RAW so the digest is hashed again while signing. However, this can cause verification failures when verifying with a system that assumes a single hash.

The hashing algorithm that Sign uses is based on the SigningAlgorithm value.

  • Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.

  • Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.

  • Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.

  • Signing algorithms that end in SHAKE_256 use the SHAKE_256 hashing algorithm.

  • SM2DSA uses the SM3 hashing algorithm. For details, see Offline verification with SM2 key pairs.