Skip to content

Instantly share code, notes, and snippets.

@jku
Created February 29, 2024 18:11
Show Gist options
  • Save jku/e3f249f3b050132f5c76ab6e9d135454 to your computer and use it in GitHub Desktop.
Save jku/e3f249f3b050132f5c76ab6e9d135454 to your computer and use it in GitHub Desktop.

Sigstore debugging snippets

  • Do you need to debug sigstore input/output files?
  • Are you not yet fluent in base64 encoded binary certificates?
  • Are you willing to use tools that are completely unfit for the purpose?

This may be the gist for you

Signature bundle

print the signing certificate in a .sigstore signature file

jq -r .verificationMaterial.x509CertificateChain.certificates[0].rawBytes a.txt.good.sigstore | base64 -d | openssl x509 -noout -text

Trust root

print all CTlog key ids in the format that openssl output uses

jq -r .ctlogs[].logId.keyId trusted_root.json | while IFS=$'\t' read value; do 
  echo $value | base64 -d | od -vt x1 -A n | sed "s/^ //" | tr 'a-z ' 'A-Z:'
  echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment