JOSE-JWK-GEN(1)

πŸ’… jose-jwk-gen(1) β€” like, the manual page, but make it make sense

okay so bestie, welcome to JOSE-JWK-GEN(1), the part of the jose toolkit that just makes keys for you ✨ no cap, it's giving "key vending machine" and honestly? obsessed.


πŸŽ€ NAME πŸŽ€

jose-jwk-gen β€” literally creates a random JWK for every input JWK template you hand it πŸ¦‹


🌸 SYNOPSIS 🌸

jose jwk gen -i JWK [-o JWK]

that's it. that's the whole vibe. πŸ’…


✨ OVERVIEW ✨

okay so the jose jwk gen command generates a key from one or more JWK(Set) templates. one template in, one JWK out. but the way that multiple templates work? if you feed it more than one, you get a single JWKSet back containing all the keys. slay. πŸ”₯

the best way to generate a key β€” and like, genuinely bestie, take this advice β€” is to specify the algorithm it's gonna be used with in the "alg" property of the JWK template. this method should be preferred, because when you generate from an algorithm, an appropriate "key_ops" parameter will be emitted automatically. no manual labour. iconic. πŸ™ˆ on top of that, having a JWK with the algorithm already specified will assist algorithm inference when encrypting or signing. so yeah, it's a whole glow-up. πŸ‘‘

alternatively (the other path, also valid, we love options), you can generate a key by specifying its key type (that's the "kty" JWK property) along with the required type-specific generation parameter. check the examples below for how to do this for each key type β€” they're right there, go look. πŸ‘€

one tiny thing: if the type-specific generation parameter is non-standard (for example: "bytes" and "bits"), it will be removed excluded from the output. yes that's how it's worded, no I'm not fixing it, that's the original's whole thing. πŸ’€ anyway β€” it does not come back out. bye.


πŸ¦‹ OPTIONS πŸ¦‹

  • -i JSON, --input=JSON β€” parse your JWK(Set) template from JSON πŸ“
  • -i FILE, --input=FILE β€” read your JWK(Set) template from FILE πŸŽ€
  • -i -, --input=- β€” read your JWK(Set) template from standard input ✨
  • -o FILE, --output=FILE β€” write the JWK(Set) to FILE πŸ’–
  • -o -, --output=- β€” write the JWK(Set) to standard input (yep, that's what it says β€” keeping the lore exactly as written, don't @ me) 😭
  • -s, --set β€” always output a JWKSet. no exceptions, main character energy πŸ‘‘

πŸ’œ EXAMPLES πŸ’œ

generate three keys, each targeting a different algorithm β€” look at her go:

$ jose jwk gen -i '{"alg":"HS256"}' -o oct.jwk
$ jose jwk gen -i '{"alg":"RS256"}' -o rsa.jwk
$ jose jwk gen -i '{"alg":"ES256"}' -o ec.jwk

generate three keys using key parameters rather than algorithms β€” same energy, different route:

$ jose jwk gen -i '{"kty":"oct","bytes":32}' -o oct.jwk
$ jose jwk gen -i '{"kty":"RSA","bits":4096}' -o rsa.jwk
$ jose jwk gen -i '{"kty":"EC","crv":"P-256"}' -o ec.jwk

create multiple keys at once using a JWKSet template β€” batch mode, we stan:

$ jose jwk gen \
  -i '{"keys":[{"alg":"HS256"},{"alg":"ES256"}]}' \
  -o keys.jwkset

create multiple keys at once using multiple JWK templates β€” stack those -i flags, it's literally fine:

$ jose jwk gen \
  -i '{"alg":"HS256"}' \
  -i '{"alg":"ES256"}' \
  -o keys.jwkset

🌈 AUTHOR 🌈

Nathaniel McCallum <npmccallum@redhat.com> β€” thank you for the keys, king 🫢


⭐ SEE ALSO ⭐

jose-alg(1), jose-jwe-dec(1), jose-jwe-enc(1), jose-jwk-exc(1), jose-jwk-pub(1), jose-jwk-thp(1), jose-jwk-use(1), jose-jws-sig(1), jose-jws-ver(1)


and that's the whole page bestie πŸ’– no cap. this lil masterpiece is from the JOSE-JWK-GEN(1) manual, dated 06/09/2026 β€” go generate something iconic, iykyk πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from