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
- https://developer.apple.com/documentation/notaryapi
- https://developer.apple.com/documentation/notaryapi/submitting_software_for_notarization_over_the_web
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notaryjerk-0.1.tar.gz.
File metadata
- Download URL: notaryjerk-0.1.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ec758aef7e58793707e8db4137e9e1c88b93607a67f73f3c71efee48ffe972
|
|
| MD5 |
e58de38dca8539f7c3b9aa2c75c960f2
|
|
| BLAKE2b-256 |
153d29dd3a8873b5568c4127a7241abb4855010cd5692903e13c118d2b1e19b2
|
File details
Details for the file notaryjerk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: notaryjerk-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c35a5b10e92ccc34b9e3b07861c87b101bbf7b9cc86700149bad407ed801283e
|
|
| MD5 |
6d6b2bb6ec87e6040f489e0c7e0dd224
|
|
| BLAKE2b-256 |
6f7816565daf1536e823cbca8bd284b839a72fa7eff7b16a06146e5c3da0b605
|
File details
Details for the file notaryjerk-0.1-py3-none-any.whl.
File metadata
- Download URL: notaryjerk-0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f913999174811ccba5db0c2249893f0a263a888b1dd88df13d03e0fa853fd9b
|
|
| MD5 |
dee377254e17cbc59d87064c559a0d08
|
|
| BLAKE2b-256 |
d77799eca60e4709fc17829be5784c02395c6512405f82fadccfd292e1d39270
|