123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #!/bin/bash -ex
- ALGS=`jose alg -k sign -k wrap -k encr | grep -v '^dir$'`
- ##
- ### Generate a key for every supported algorithm
- ##
- for a in $ALGS; do
- jose jwk gen -i "{\"alg\": \"$a\"}"
- done
- ##
- ### Generate a key for each parameter
- ##
- jose jwk gen -i '{ "kty": "EC", "crv": "P-256" }'
- jose jwk gen -i '{ "kty": "EC", "crv": "P-384" }'
- jose jwk gen -i '{ "kty": "EC", "crv": "P-521" }'
- jose jwk gen -i '{ "kty": "RSA", "bits": 3072 }'
- jose jwk gen -i '{ "kty": "RSA", "bits": 3072, "e": 257 }'
- jose jwk gen -i '{ "kty": "RSA", "bits": 3072, "e": "AQE" }'
- jose jwk gen -i '{ "kty": "oct", "bytes": 32 }'
- ##
- ### Test the key types we can't generate
- ##
- ! jose jwk gen -i '{"alg": "dir"}'
- ##
- ### Test the set output option
- ##
- jose jwk gen -s -i '{ "kty": "EC", "crv": "P-256" }' \
- | jose fmt -j- -Og keys -A \
- -l -j 1 -EUU \
- -g 0 -O \
- -g kty -q EC -EUU \
- -g crv -q P-256 -EUU
|