1JOSE-JWK-USE(1)                                                JOSE-JWK-USE(1)
2
3
4

NAME

6       jose-jwk-use - Validates a key for the specified use(s)
7

SYNOPSIS

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

OVERVIEW

12       The  jose  jwk  use command validates one or more JWK(Set) inputs for a
13       given set of usages. This will  be  validated  against  the  "use"  and
14       "key_ops" properties of each JWK.
15
16       By  default, if a JWK has no restrictions an operation will be allowed.
17       However, by specifying the -r option you can ensure that a JWK will not
18       be allowed unless it explicitly permits the option.
19
20       In  normal  operation, jose jwk use will fail if any of the JWKs do not
21       validate. However, if the -o option is used jose jwk use  will  instead
22       write  a JWK(Set) containing all of the input keys that validate. If no
23       JWKs validate, the command will fail.
24

OPTIONS

26       -i JSON, --input=JSON
27              Parse JWK(Set) from JSON
28
29       -i FILE, --input=FILE
30              Read JWK(Set) from FILE
31
32       -i -, --input=-
33              Read JWK(Set) standard input
34
35       -u sign, --use=sign
36              Validate the key for signing
37
38       -u verify, --use=verify
39              Validate the key for verifying
40
41       -u encrypt, --use=encrypt
42              Validate the key for encrypting
43
44       -u decrypt, --use=decrypt
45              Validate the key for decrypting
46
47       -u wrapKey, --use=wrapKey
48              Validate the key for wrapping
49
50       -u unwrapKey, --use=unwrapKey
51              Validate the key for unwrapping
52
53       -u deriveKey, --use=deriveKey
54              Validate the key for deriving keys
55
56       -u deriveBits, --use=deriveBits
57              Validate the key for deriving bits
58
59       -a, --all
60              Succeeds only if all operations are allowed
61
62       -r, --required
63              Operations must be explicitly allowed
64
65       -o FILE, --output=FILE
66              Filter keys to FILE as JWK(Set)
67
68       -o -, --output=-
69              Filter keys to standard output as JWK(Set)
70
71       -s, --set
72              Always output a JWKSet
73

EXAMPLES

75       Examples of both success and failure from a private and public key:
76
77
78
79           $ jose jwk gen -i ´{"alg":"ES256"}´ -o prv.jwk
80           $ jose jwk pub -i prv.jwk -o pub.jwk
81           $ jose jwk use -i prv.jwk -u sign
82           $ echo $?
83           0
84           $ jose jwk use -i pub.jwk -u sign
85           $ echo $?
86           1
87
88
89

AUTHOR

91       Nathaniel McCallum <npmccallum@redhat.com>
92

SEE ALSO

94       jose-jwk-gen(1)
95
96
97
98                                   June 2017                   JOSE-JWK-USE(1)
Impressum