JWK2KEY(1)

πŸ“¦ version 3.3.3, in alpine 3.24, ubuntu resolute, ubuntu stonking

πŸ’– JWK2KEY πŸ’–

okay bestie, so this is the jwk2key page from the LibJWT C Library manual, and it's literally the tool that takes your JSON Web Keys and exports them as PKCS8. she's niche, she's powerful, she's giving ✨key management✨. let's get into it 🫢


✨ NAME ✨

jwk2key β€” Export JSON Web Keys to PKCS8. no cap, that's the whole job description. πŸ’…


🌸 SYNOPSIS 🌸

jwk2key [options] <FILE> [FILE]...

πŸ¦‹ DESCRIPTION πŸ¦‹

so jwk2key takes your JSON Web Key files and exports each key out to a PKCS8 PEM file. one key in, one file out, we love a clean handoff. πŸ’–

this program will parse a JSON Web Key or a Set, and write out the individual files into DIR β€” and btw DIR defaults to '.'. the output directory has to already exist, she will not create it for you, okay? and you should make sure the permissions on the output directory are such that they cannot be accessed by others. that's not a vibe suggestion, that's a real one. lock it down bestie πŸ”’

JWK files must be listed after any options. and a - will be interpreted as stdin. cute, right? πŸ’«

all RSA key types will be written as plain RSA keys, and that includes RSASSA-PSS keys too β€” unless it has a PS256, PS384, or PS512 alg attribute. so basically PSS stays PSS only when it says so. noted. πŸ“

all keys are written in PKCS8 PEM format, except key type OCT, which gets written as a binary file (.bin extension). OCT said "not like the other girls" and honestly, respect. πŸ’€

by default, existing files will not be overwritten. like, she's polite. if you use the --retry option, an attempt will be made to add -1 to the file name, up to -9, in an attempt to create the file. so you get nine whole chances, slay. πŸŽ€

output file naming is based on (hopefully) unique characteristics, including:

  • Key type β€” e.g. rsa, ec, etc.
  • Bits in the key β€” e.g. 2048 for an RSA key, or 384 for an EC key.
  • Private vs Public β€” public keys will have _pub added to the end of the filename (before the extension).
  • Most importantly, the kid attribute, which is supposed to be unique. πŸ‘‘

🌈 Options 🌈

  • -h, --help β€” show common options and quit. the classic "wait what does this do again" button 🫢
  • -r, --retry β€” retry if the output file exists. she'll keep trying, she's persistent like that ✨
  • -d DIR, --dir=DIR β€” directory to write key files to (default is '.'). yes, the default is literally just '.', the dot is part of it, don't come for me πŸ’…

πŸ’€ BUGS πŸ’€

see GitHub Issues: https://github.com/benmcollins/libjwt/issues

(yes bestie, go file it, they're nice, it's giving open source community 🌸)


πŸ‘‘ AUTHOR πŸ‘‘

jwk2key written by Ben Collins bcollins@libjwt.io. ty for your service king 🫑


🌟 SEE ALSO 🌟

jwt-verify(1), jwt-generate(1), key2jwk(1)


and that's the whole page!! this is the jwk2key User Manual, page JWK2KEY(1), straight from the LibJWT C Library era β€” go forth and export those keys responsibly, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from