Blob Blame History Raw
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "JOSE\-JWK\-USE" "1" "July 2019" "" ""
.
.SH "NAME"
\fBjose\-jwk\-use\fR \- Validates a key for the specified use(s)
.
.SH "SYNOPSIS"
\fBjose jwk use\fR \-i JWK [\-a] [\-r] \-u OP
.
.SH "OVERVIEW"
The \fBjose jwk use\fR command validates one or more JWK(Set) inputs for a given set of usages\. This will be validated against the "use" and "key_ops" properties of each JWK\.
.
.P
By default, if a JWK has no restrictions an operation will be allowed\. However, by specifying the \fB\-r\fR option you can ensure that a JWK will not be allowed unless it explicitly permits the option\.
.
.P
In normal operation, \fBjose jwk use\fR will fail if any of the JWKs do not validate\. However, if the \fB\-o\fR option is used \fBjose jwk use\fR will instead write a JWK(Set) containing all of the input keys that validate\. If no JWKs validate, the command will fail\.
.
.SH "OPTIONS"
.
.TP
\fB\-i\fR \fIJSON\fR, \fB\-\-input\fR=\fIJSON\fR
Parse JWK(Set) from JSON
.
.TP
\fB\-i\fR \fIFILE\fR, \fB\-\-input\fR=\fIFILE\fR
Read JWK(Set) from FILE
.
.TP
\fB\-i\fR \-, \fB\-\-input\fR=\-
Read JWK(Set) standard input
.
.TP
\fB\-u\fR sign, \fB\-\-use\fR=sign
Validate the key for signing
.
.TP
\fB\-u\fR verify, \fB\-\-use\fR=verify
Validate the key for verifying
.
.TP
\fB\-u\fR encrypt, \fB\-\-use\fR=encrypt
Validate the key for encrypting
.
.TP
\fB\-u\fR decrypt, \fB\-\-use\fR=decrypt
Validate the key for decrypting
.
.TP
\fB\-u\fR wrapKey, \fB\-\-use\fR=wrapKey
Validate the key for wrapping
.
.TP
\fB\-u\fR unwrapKey, \fB\-\-use\fR=unwrapKey
Validate the key for unwrapping
.
.TP
\fB\-u\fR deriveKey, \fB\-\-use\fR=deriveKey
Validate the key for deriving keys
.
.TP
\fB\-u\fR deriveBits, \fB\-\-use\fR=deriveBits
Validate the key for deriving bits
.
.TP
\fB\-a\fR, \fB\-\-all\fR
Succeeds only if all operations are allowed
.
.TP
\fB\-r\fR, \fB\-\-required\fR
Operations must be explicitly allowed
.
.TP
\fB\-o\fR \fIFILE\fR, \fB\-\-output\fR=\fIFILE\fR
Filter keys to FILE as JWK(Set)
.
.TP
\fB\-o\fR \-, \fB\-\-output\fR=\-
Filter keys to standard output as JWK(Set)
.
.TP
\fB\-s\fR, \fB\-\-set\fR
Always output a JWKSet
.
.SH "EXAMPLES"
Examples of both success and failure from a private and public key:
.
.IP "" 4
.
.nf

$ jose jwk gen \-i \(aq{"alg":"ES256"}\(aq \-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
.
.fi
.
.IP "" 0
.
.SH "AUTHOR"
Nathaniel McCallum <npmccallum@redhat\.com>
.
.SH "SEE ALSO"
\fBjose\-jwk\-gen\fR(1)