Files
floci/compatibility-tests/sdk-test-awscli/test
TiM 9ea28ee629 fix(kms): support HMAC_* key specs in CreateKey (#544)
CreateKey with `--key-spec HMAC_{224,256,384,512} --key-usage
GENERATE_VERIFY_MAC` now succeeds instead of throwing
InvalidCustomerMasterKeySpecException. DescribeKey returns the matching
MacAlgorithms array (HMAC_SHA_*), and GetPublicKey correctly rejects
HMAC keys with UnsupportedOperationException.

Validation also rejects the two incompatible pairings:
- HMAC_* without GENERATE_VERIFY_MAC usage
- GENERATE_VERIFY_MAC usage with any non-HMAC spec

HMAC material is generated with SecureRandom and base64-stored on the
existing privateKeyEncoded field (same pattern as RSA/ECC private key
bytes). Generation sits outside the try block that wraps asymmetric
keypair creation, so ValidationExceptions aren't rewrapped as 500s.

Closes #497.

Out of scope (follow-up PRs):
- GenerateMac / VerifyMac operations
- HMAC key rotation support
- Catch-rewrap bug in generateKeyMaterial for asymmetric keys
2026-04-21 19:38:54 -05:00
..