Skip to main content

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

Metadata

Release files for notaryjerk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notaryjerk 0.1.1
File Size Uploaded Provenance Actions
notaryjerk-0.1.1.tar.gz 62.4 kB Without provenance Details for notaryjerk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for notaryjerk 0.1.1
File Interpreter ABI Platform Actions
notaryjerk-0.1.1-py3-none-any.whl Python 3 none any Details for notaryjerk-0.1.1-py3-none-any.whl

Total release size: 112.7 kB

Release files / notaryjerk-0.1.1.tar.gz

Download URL notaryjerk-0.1.1.tar.gz
Size 62.4 kB
Tags Source
SHA-256 checksum
How to use checksums
48d54dce66e83e2d7efe5bb5987f80d6888d94b141fa3c2c1e5d51335caeb535
BLAKE2b-256 checksum
How to use checksums
2e7f26be776ef1273375bf58be86b114ceff3a1daadb8750e19af4697c66f2b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / notaryjerk-0.1.1-py3-none-any.whl

Download URL notaryjerk-0.1.1-py3-none-any.whl
Size 50.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e04fc21eec78775af4e40835aa0dfd144c08a91e4c3731f7c97d54f35c2ad88
BLAKE2b-256 checksum
How to use checksums
df454c6a45b608aaa787dd39fc561f634a16728c773cf6a20d52209dcbfb8b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for notaryjerk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page