JWK2KEY(1)
π 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.
2048for an RSA key, or384for an EC key. - Private vs Public β public keys will have
_pubadded to the end of the filename (before the extension). - Most importantly, the
kidattribute, 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
- alpine 3.24: libjwt-doc 3.3.3-r0 Β· MPL-2.0
- ubuntu resolute: jwt-tools 3.2.3-1 Β· MPL-2.0
- ubuntu stonking: jwt-tools 3.3.3-1build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms