Skip to main content

pysigning

Python library and CLI scripts for signing and verifying data

Install

pip3 install -U pysigning

Usage

Generate a random signing key for testing

# generate private key as "sign.key"
openssl genrsa -out sign.key 2048

# get private key's public key as "sign.crt"
openssl rsa -in sign.key -pubout -out sign.crt

CLI

Generate a signature for the file LICENSE using the private key sign.key

$ pysigning sign @LICENSE --key sign.key
gdFNOO9cwpYXWv9TfulFauNQ5S1WXXIQAuXC4qQB9vyOMhZW0hOl0fvyyHC1pNzZAOrpUNEoQuvvs6w2r0TdzcMsA_finu5RVVzzko4kQuOWM6Tw3CX6ln82h8z2gWyKRhIC71pScpy7MJO8IEFBBPqQbR5NDFvGVh9F69S3pVZzf4xqrkcBBWoJr2DjD-VFQ6S5hFA0PQ685cDY26hB07MWoLVHFz5jyqDfDmGqNRb5bY7fUzmJCdY5wdLExrrJQJaZhU9Ak_HAA3zsmvy0OSRTNJY7BIwVdopQ_dN-CdTLQgsoEfqpvLVp6HLRuZWhftnMlkmq0vTypgh24kYyCg==

Verify the signature of the file LICENSE using the public key sign.crt

$ pysigning sign @LICENSE --key sign.key | pysigning verify @LICENSE - --key sign.crt
True

Library

import pysigning

# Generate a signature for the file `LICENSE` using the private key `sign.key`
sig = pysigning.sign('@LICENSE', key="sign.key")
print(sig)

# Verify the signature of the file `LICENSE` using the public key `sign.crt`
assert pysigning.verify('@LICENSE', sig, key="sign.crt")

License

MIT

Contact

A library by Shawn Presser. If you found it useful, please consider joining my patreon!

My Twitter DMs are always open; you should send me one! It's the best way to reach me, and I'm always happy to hear from you.

Metadata

Release files for pysigning 0.3.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 pysigning 0.3.1
File Size Uploaded Provenance
pysigning-0.3.1.tar.gz 5.2 kB Without provenance Details

Release files / pysigning-0.3.1.tar.gz

Download URL pysigning-0.3.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c30ecfa0887922e1482e7755dbb5ae621fe844d2faf10de43b04cb8dbcfc02ab
BLAKE2b-256 checksum
How to use checksums
93e3d999bc568b1e7f12e5ce2bf9b9e33c707ea7df4362b81ec68770b1758666
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0a2 CPython/3.9.5 Darwin/20.5.0

Security for pysigning 0.3.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.

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