After creating a key pair in AWS KMS service I can see the public key looks something like:
-----BEGIN PUBLIC KEY-----
J1UJQVArKIBiUNUgvkEamuz4treK5qSCJeUD+TcN9lPEQTXrApYV+CcXnuQJql472gPGtTNbyE
-----END PUBLIC KEY-----
But when clients invoke the jwks endpoint url (e.g. https://my-authorization-service.com/.well-known/jwks)
I want the response to look like any other conventional (e.g. google jwks etc.) jwks response, like this:
{
"alg": "RS256",
"kty": "RSA",
"use": "sig",
"n": "vYjDQCjiQCjiQCjiQCjiQCji",
"e": "AQAB",
"kid": "79adDfP_ggD-fuxsFWdkd",
"x5t": "aaaaaaabbbbbbbbcccccccc",
"x5c": [
"the_x5c_bla_bla"
]
}
The purpose of this JWKs endpoint is to have authorizers refer to this endpoint to fetch the correct JWKs key in order to verify/validate a JWT token that has been signed by the private key.
How can I present the KMS public key in a JWKs format as described above ? or am I doing something wrong?