Skip to content

Instantly share code, notes, and snippets.

View brunerd's full-sized avatar

Joel Bruner brunerd

View GitHub Profile
@peasead
peasead / extract-pkg-x509-cert.md
Last active September 10, 2024 07:42
Extracting code-signing certificates from .pkg files

Extract x509 Certificates from macOS .pkg files

Extracts the package table of contents as an XML file

xar --dump-toc={header.xml} -f {file.pkg}

Clean up the TOC to just the RSA signature information

/usr/bin/xmllint --xpath '//signature[@style="RSA"]' {header.xml} > {rsa.raw}