jose-jwk-use - Man Page

Validates a key for the specified use(s)

Synopsis

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

Overview

The jose jwk use 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.

By default, if a JWK has no restrictions an operation will be allowed. However, by specifying the -r option you can ensure that a JWK will not be allowed unless it explicitly permits the option.

In normal operation, jose jwk use will fail if any of the JWKs do not validate. However, if the -o option is used jose jwk use will instead write a JWK(Set) containing all of the input keys that validate. If no JWKs validate, the command will fail.

Options

Examples

Examples of both success and failure from a private and public key:

$ 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

Author

Nathaniel McCallum <npmccallum@redhat.com>

See Also

jose-jwk-gen(1)

Referenced By

jose(1), jose-jwk-gen(1), jose-jwk-pub(1).

04/03/2024