Skip to main content

tools for codesigning and notarization of binaries

Project description

notaryjerk - cross platform notarization for macOS binaries

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).

AFAIK, this is currently the only tool, that allows (somewhat easy) notarization of macOS binaries on platforms other than macOS.

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:

pip install notaryjerk

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.1.1.tar.gz (62.4 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.1.1-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for notaryjerk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 48d54dce66e83e2d7efe5bb5987f80d6888d94b141fa3c2c1e5d51335caeb535
MD5 7564b3d82eb3fbe8b7b721600d963d3a
BLAKE2b-256 2e7f26be776ef1273375bf58be86b114ceff3a1daadb8750e19af4697c66f2b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: notaryjerk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 50.3 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e04fc21eec78775af4e40835aa0dfd144c08a91e4c3731f7c97d54f35c2ad88
MD5 69b57d024c448e6932154f05e0a1023b
BLAKE2b-256 df454c6a45b608aaa787dd39fc561f634a16728c773cf6a20d52209dcbfb8b3c

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