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 fromFILEπ-i -,--input=-β read your JWK(Set) template from standard input β¨-o FILE,--output=FILEβ write the JWK(Set) toFILEπ-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
- arch rolling: jose 15-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms