Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

keycloak_pkey_to_jwks

Convert an RSA public key (base64-encoded DER, the “Public key” that Keycloak shows for a realm key) into ONE JWK, an entry of C_AUTHZ’s jwks. The issuer string becomes the key’s kid: give the issuer (iss) of the tokens, never *. The JWK is printed to stdout. (Source dir: utils/c/pkey_to_jwks.)

Usage

keycloak_pkey_to_jwks --iss <issuer> <base64-der-public-key>
OptionPurpose
--issIssuer of the tokens (the realm’s URL), used as the JWK kid. Required.

Example:

keycloak_pkey_to_jwks --iss https://auth.example.com/realms/example MIIBIjANBgkq...
{
    "kid": "https://auth.example.com/realms/example",
    "description": "",
    "use": "sig",
    "kty": "RSA",
    "alg": "RS256",
    "n": "<base64url modulus>",
    "e": "AQAB"
}

See also