KMS: add RSA_3072 and ECC NIST key specs with ECDSA signing - #17
Merged
Conversation
Support ECC_NIST_P256/P384/P521 sign-only keys with DER-encoded (RFC 3279) ECDSA signatures matching real AWS KMS, validate signing algorithms against key spec, and reject Encrypt/Decrypt on ECC keys. Fixes: #16 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bump Aspire to 13.5.3, Amazon.Lambda packages to v3, xunit.v3 to 4.0.0, and pinned AWSSDK.SQS/Mvc.Testing versions to clear the transitive MessagePack vulnerability blocking CI restore. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The KMS handler only supported
SYMMETRIC_DEFAULT,RSA_2048, andRSA_4096, which blocked integration-testing JWT signing scenarios (RS384/PS384 and ES256/ES384/ES512) against MicroStack.Changes
RSA_3072: extends the existing RSA branch; reuses the current PKCS1/PSS signing algorithm list.ECC_NIST_P256/P384/P521create anECDsakey alongside the existingRsaKey, exporting the public key as DERSubjectPublicKeyInfo. Each curve advertises its single matching algorithm (ECDSA_SHA_256/384/512).Sign/VerifyuseDSASignatureFormat.Rfc3279DerSequence, matching real AWS KMS (ANSI X9.62Ecdsa-Sig-Value), not IEEE P1363 rawr||s.Sign/Verifynow validate the requested algorithm against the key's advertisedSigningAlgorithms, returningValidationExceptionon mismatch (e.g.ECDSA_SHA_384on a P-256 key) - this also tightens the previous RSA behavior.KeyUsage: SIGN_VERIFYat creation and rejectEncrypt/DecryptwithValidationException.ECC_SECG_P256K1is left out per the issue (optional, lower priority).Testing
GetPublicKeySPKI viaECDsa.VerifyData, plus rejection tests for wrong algorithm, wrong key usage, and encrypt/decrypt on ECC keys.dotnet format --verify-no-changes.Docs page
docs/services/kmsupdated with the new specs and DER signature semantics.Fixes: #16