Skip to content

Instantly share code, notes, and snippets.

@omarstreak
Created January 18, 2013 01:41
Show Gist options
  • Save omarstreak/4561601 to your computer and use it in GitHub Desktop.
Save omarstreak/4561601 to your computer and use it in GitHub Desktop.
Create and sign your safari extension file
XAR=path/to/xar/bin
BUILD_DIR=path/to/dir/with/cert/files
EXTENSION=your extension name
$XAR -czf $EXTENSION.safariextz --distribution $EXTENSION.safariextension
$XAR --sign -f $EXTENSION.safariextz --digestinfo-to-sign digest.dat --sig-size `cat $BUILD_DIR/size.txt` --cert-loc $BUILD_DIR/cert.der --cert-loc $BUILD_DIR/cert01 --cert-loc $BUILD_DIR/cert02
openssl rsautl -sign -inkey $BUILD_DIR/key.pem -in digest.dat -out sig.dat
$XAR --inject-sig sig.dat -f $EXTENSION.safariextz
rm -f sig.dat digest.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment