blob: fd87ca6112a14db4731b3d8f28ea162e1fdd9f17 [file]
.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "JWK2KEY" "1" "" "jwk2key User Manual" "LibJWT C Library"
.SH NAME
\f[B]jwk2key\f[R] \- Export JSON Web Keys to PKCS8
.SH SYNOPSIS
.PP
\f[B]jwk2key\f[R] \f[B][options]\f[R] <FILE> [FILE]\&...
.SH DESCRIPTION
\f[B]jwk2key\f[R] Takes JSON Web Key files and exports each key to a
PKCS8 PEM file
.PP
This program will parse a JSON Web Key or Set and write out the
individual files to DIR (by default `\f[B].\f[R]').
Output directory must exist.
You should make sure the permissions on the output directory are such
that they cannot be accessed by others.
.PP
JWK files must be listed after any options.
A \f[B]\-\f[R] will be interpreted as \f[I]stdin\f[R].
.PP
All \f[I]RSA\f[R] key types will be written as plain \f[I]RSA\f[R] keys,
including \f[I]RSASSA\-PSS\f[R] keys, unless it has a \f[I]PS256\f[R],
\f[I]PS384\f[R], or \f[I]PS512\f[R] \f[B]alg\f[R] attribute.
.PP
All keys are written in PKCS8 PEM format, except key type \f[I]OCT\f[R],
which is written as a binary file (.bin extension).
.PP
By default, existing files will not be overwritten.
If you use the \f[B]\-\-retry\f[R] option, an attempt will be made to
add \-1 to the file name, up to \-9, in an attempt to create the file.
.PP
Output file naming is based on (hopefully) unique characteristics,
including:
.IP \[bu] 2
\f[B]Key type\f[R] E.g.
\f[B]rsa\f[R], \f[B]ec\f[R], etc.
.IP \[bu] 2
\f[B]Bits\f[R] in the key.
E.g.
2048 for an \f[I]RSA\f[R] key, or 384 for an \f[I]EC\f[R] key.
.IP \[bu] 2
\f[B]Private\f[R] vs \f[B]Public\f[R].
Public keys will have \f[B]_pub\f[R] added to the end of the filename
(before the extension).
.IP \[bu] 2
Most importantly, the \f[B]kid\f[R] attribute, which is supposed to be
unique.
.SS Options
.TP
\f[B]\-h\f[R], \f[B]\-\-help\f[R]
Show common options and quit.
.TP
\f[B]\-r\f[R], \f[B]\-\-retry\f[R]
Retry if output file exists.
.TP
\f[B]\-d\f[R] \f[I]DIR\f[R], \f[B]\-\-dir\f[R]=\f[I]DIR\f[R]
Directory to write key files to (default is `\f[B].\f[R]').
.SH BUGS
See GitHub Issues: \c
.UR https://github.com/benmcollins/libjwt/issues
.UE \c
.SH AUTHOR
\f[B]jwk2key\f[R] written by Ben Collins \c
.MT bcollins@libjwt.io
.ME \c
\&.
.SH SEE ALSO
\f[B]jwt\-verify(1)\f[R], \f[B]jwt\-generate(1)\f[R],
\f[B]key2jwk(1)\f[R]