JOSE-JWK-USE(1)

πŸ’… jose-jwk-use(1) β€” the manual page, bestie edition

okay so this is the jose-jwk-use(1) page and honestly it's lowkey one of the most useful little gremlins in the whole jose toolbox. it's all about asking a key politely (or not so politely) whether it's allowed to do a thing. let's get into it πŸŽ€


✨ NAME ✨

jose-jwk-use β€” validates a key for the specified use(s). that's it. that's the whole vibe check. πŸ’…


🌸 SYNOPSIS 🌸

jose jwk use -i JWK [-a] [-r] -u OP

πŸ¦‹ OVERVIEW πŸ¦‹

okay so picture this: the jose jwk use command validates one or more JWK(Set) inputs for a given set of usages. and how does it validate them, you ask? it checks them against the "use" and "key_ops" properties of each JWK. that's the whole assignment. πŸ“

by default, if a JWK has no restrictions, an operation will be allowed. like, no rules means no problem, the key is just out here living its life freely. ✨ however β€” and this is the important part, bestie, don't skip it β€” if you specify the -r option, you can ensure that a JWK will not be allowed unless it explicitly permits the option. so instead of "no restrictions = sure go ahead", it becomes "no explicit permission = absolutely not, ma'am." πŸ™…β€β™€οΈ

in normal operation, jose jwk use will fail if any of the JWKs do not validate. like, the whole thing just gives up. 😭 but! if the -o option is used, jose jwk use will instead write a JWK(Set) containing all of the input keys that validate. it's like a little bouncer at the club, checking IDs and only letting the valid ones inside. 🎟️ and if no JWKs validate? the command will fail. empty club, party's over, lights on. πŸ’€


🌈 OPTIONS 🌈

  • -i JSON, --input=JSON β€” parse JWK(Set) from JSON. you're handing it the actual JSON right there on the command line, no file needed bestie πŸ’–
  • -i FILE, --input=FILE β€” read JWK(Set) from FILE. the classic. the standard. the "i saved it to disk like a responsible person" move πŸ“
  • -i -, --input=- β€” read JWK(Set) from standard input. that lil - means stdin, iykyk 🫢
  • -u sign, --use=sign β€” validate the key for signing ✍️
  • -u verify, --use=verify β€” validate the key for verifying πŸ”
  • -u encrypt, --use=encrypt β€” validate the key for encrypting πŸ”
  • -u decrypt, --use=decrypt β€” validate the key for decrypting πŸ”“
  • -u wrapKey, --use=wrapKey β€” validate the key for wrapping 🎁
  • -u unwrapKey, --use=unwrapKey β€” validate the key for unwrapping πŸŽ€
  • -u deriveKey, --use=deriveKey β€” validate the key for deriving keys 🌱
  • -u deriveBits, --use=deriveBits β€” validate the key for deriving bits ⚑
  • -a, --all β€” succeeds only if all operations are allowed. all of them. every single one. no stragglers. πŸ‘‘
  • -r, --required β€” operations must be explicitly allowed. like we said up top, no explicit permission means no deal 🚫
  • -o FILE, --output=FILE β€” filter keys to FILE as JWK(Set). only the survivors get written out πŸ’Ύ
  • -o -, --output=- β€” filter keys to standard output as JWK(Set). yep, - again, this time it's stdout πŸ’¬
  • -s, --set β€” always output a JWKSet. no matter what. set energy only. 🧺

πŸ“ EXAMPLES πŸ“

here's what success and failure look like, using a private key and a public key. watch the exit codes, they're the whole story ngl πŸ‘€

$ jose jwk gen -i '{"alg":"ES256"}' -o prv.jwk
$ jose jwk pub -i prv.jwk -o pub.jwk
$ jose jwk use -i prv.jwk -u sign
$ echo $?
0
$ jose jwk use -i pub.jwk -u sign
$ echo $?
1

see that? the private key said "yes bestie, i can sign" and gave us 0. the public key said "absolutely not, i'm the public one" and gave us 1. iconic behaviour from both of them honestly πŸ’€βœ¨


πŸ’œ AUTHOR πŸ’œ

Nathaniel McCallum <npmccallum@redhat.com> β€” the main character who wrote this 🫢


⭐ SEE ALSO ⭐


okay that's the whole page, you ate that, periodt. 🧚 this was jose-jwk-use(1), dated 06/09/2026, and you can find it filed under the JOSE-JWK-USE(1) manual. mwah, go validate some keys πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from