jose-jwk-thp 756 B

12345678910111213141516171819202122
  1. #!/bin/sh -ex
  2. a=`jose jwk thp -i $VECTORS/rfc7638_3.1.jwk -a S256`
  3. b=`cat $VECTORS/rfc7638_3.1.thp`
  4. [ $a = $b ]
  5. jwk=`jose jwk thp -i $VECTORS/rfc7520_4.8.jwkset -a S1 -f HYRNOxxOOHap0amTONoy1bHnS5M`
  6. [ "`echo ${jwk} | jose jwk thp -i- -a S1`" = "HYRNOxxOOHap0amTONoy1bHnS5M" ]
  7. jose fmt -j "$jwk" -O \
  8. -g kty -q EC -EUU \
  9. -g crv -q P-521 -EUU \
  10. -g kid -q bilbo.baggins@hobbiton.example -EUU
  11. ! jose jwk thp -i $VECTORS/rfc7520_4.8.jwkset -a S1 -f VHriznG7vJAFpXMXRmGgAkA5sEE
  12. # Check default thumbprint algorithm (SHA-256).
  13. RFC_7638_3_1="${VECTORS}/rfc7638_3.1"
  14. jwk="${RFC_7638_3_1}.jwk"
  15. thp256="${RFC_7638_3_1}.thp"
  16. [ "$(jose jwk thp -i ${jwk})" = "$(jose jwk thp -i ${jwk} -a S256)" ]
  17. [ "$(jose jwk thp -i ${jwk})" = "$(cat ${thp256})" ]