Skip to main content

tools for codesigning and notarization of binaries

Project description

notaryjerk - helper for macOS codesigning and notarization

This started as a replacement for Apple's notarytool (which requires XCode>=13.x), by using the Apple's API directly.

It is now intended as a general toolset that helps with creating and distributing signed binary packages, that is usable on any platform supporting Python (not necessarily the target platform of the codesigned binaries. E.g. you can notarize macOS binaries under Linux).

While we are primarily targeting macOS binaries, the idea is to extend this to Windows as well.

Tools

Code Signing

TODO

Notarization

import notaryjerk.notarize

Stapling

import notaryjerk.staple

Creating a DMG

TODO

How To

Installation

The easiest way is probably using pip:

pip3 install git+https://git.iem.at/zmoelnig/notaryjerk.git

Usage

As a script

Notarize a disk image:

You must have signed up with Apple and created an API-Key to access the "App Store Connect API". You will get a private key file (keep it private; in the example below I assume the key is stored in priv.pem), a key-id (let's assume 2X9R4HXF34) and an issuer-id (e.g. 57246542-96fe-1a63-e053-0824d011072a).

Once you have all these, you can notarize your signed application stored in MyApp.dmg like so:

notaryjerk notarize \
    --private-keyfile priv.pem --key-id 2X9R4HXF34 --issuer-id 57246542-96fe-1a63-e053-0824d011072a \
    --token-file mytoken.txt \
    MyApp.dmg

This will create a temporary token (valid for 5 minutes, but that can be changed with the --token-timeout option) and use it to submit the notarization request. If you want to create many (different) notarization requests, you can also pass --token-file to store the generated token to disk. In subsequent calls, you only need to pass the --token-file option (and leave the --private-keyfile/--key-id/--issuer-id) to reuse the same token until it has expired.

Notarize a ZIP-file and wait until the request has been accepted

Apple accepts both disk image files and ZIP-archives.

With the --wait parameter, notaryjerk keeps running until the notarization request has been processed. A JSON-formatted report can be saved to disk with the --status-file option (otherwise it will be printed to stdout)

notaryjerk notarize --token-file mytoken.txt --wait --status-file notarization.json MyApp.zip

Notarize multiple files and notify a webhook

notaryjerk notarize --token-file mytoken.txt --webhook https://example.com/notary_callback MyApp.dmg AnotherApp.zip

Staple a notarization ticket into a bundle

Once the notarization was successful, you can staple the ticket into an Application bundle.

notaryjerk staple AnotherApp.app/

You can only staple bundles (esp: you cannot staple single binaries)

Useful links

Author

IOhannes m zmölnig (Institute of Electronic Music and Acoustics (IEM), KUG, Graz/Austria)

License

This code is released under the GNU Affero General Public License, version 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notaryjerk-0.0.0.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notaryjerk-0.0.0-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file notaryjerk-0.0.0.tar.gz.

File metadata

  • Download URL: notaryjerk-0.0.0.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for notaryjerk-0.0.0.tar.gz
Algorithm Hash digest
SHA256 d2337b49dc6b7cc925e951950097d18d539d9e78dcf522e57ffdb4a6d4298eec
MD5 576fd86ff18fde77e0d7dc239776681f
BLAKE2b-256 4fb2e6fc2493796215877c13fde70d8c3c6c16462a4189d06b88644c8942aa76

See more details on using hashes here.

File details

Details for the file notaryjerk-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: notaryjerk-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for notaryjerk-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdd63acead749a39f2ac3073ad5a0acccac9ca27667a2d338c5f8bc0a36767d3
MD5 8c0bc6b5c4f37e83f0b220608bd0a834
BLAKE2b-256 a92863c909d76af78606b5614aa9b5f1a4838adcbc231d1ec0f86aee38cf70c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page