Skip to content

Instantly share code, notes, and snippets.

@shigeya
Last active June 23, 2022 08:16
Show Gist options
  • Select an option

  • Save shigeya/6a9288286da274d4c25a1e4a584df5f5 to your computer and use it in GitHub Desktop.

Select an option

Save shigeya/6a9288286da274d4c25a1e4a584df5f5 to your computer and use it in GitHub Desktop.
JWKS decoder for Vaccine Certificate JWKS
#!/bin/sh
#
# Following two commands required
# jq -- https://stedolan.github.io/jq/ # or brew install jq
# base64 -- https://www.fourmilab.ch/webtools/base64/ # or brew install base64
#
# This code stored as public gist at:
# https://gist.github.com/shigeya/6a9288286da274d4c25a1e4a584df5f5
curl -s -O https://vc.vrs.digital.go.jp/issuer/.well-known/jwks.json
jq '.keys[0]["x5c"][0]' < jwks.json | sed -e s/\"//g > issuer.der.base64url
jq '.keys[0]["x5c"][1]' < jwks.json | sed -e s/\"//g > ca.der.base64url
jq '.keys[0]["x5c"][2]' < jwks.json | sed -e s/\"//g > root.der.base64url
for i in issuer ca root
do
base64 -d < $i.der.base64url > $i.der
echo "# $i"
openssl x509 -inform der -in $i.der -text > $i.text
cat $i.text
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment