This is a simple tool to rotate a set of AWS KMS keys and generate a JWKS (JSON Web Key Set) from them.
The easiest to install is to use go:
$ go install github.com/exaring/kms-jwks-managerThe following will create three KMS keys with three respective aliases: EXAMPLE-current, EXAMPLE-next and EXAMPLE-previous.
$ kms-jwks-manager --key-alias-prefix=EXAMPLE rotateIf the keys already exist, the tool will rotate them:
nextbecomescurrent- the
previouskey is scheduled for deletion - a new
nextkey is created currentbecomesprevious
The following will export the JWKS to a file:
$ kms-jwks-manager --key-alias-prefix=EXAMPLE export --algorithm RS256 > jwks.json