Skip to main content
Latest Version https://img.shields.io/travis/matrix-org/python-signedjson.svg

Signs JSON objects with ED25519 signatures.

Features

  • More than one entity can sign the same object.

  • Each entity can sign the object with more than one key making it easier to rotate keys

  • ED25519 can be replaced with a different algorithm.

  • Unprotected data can be added to the object under the "unsigned" key.

Installing

pip install signedjson

Using

from signedjson.key import generate_signing_key, get_verify_key
from signedjson.sign import (
    sign_json, verify_signed_json, SignatureVerifyException
)

signing_key = generate_signing_key('zxcvb')
signed_json = sign_json({'my_key': 'my_data'}, 'Alice', signing_key)

verify_key = get_verify_key(signing_key)

try:
    verify_signed_json(signed_json, 'Alice', verify_key)
    print 'Signature is valid'
except SignatureVerifyException:
    print 'Signature is invalid'

Format

{
    "<protected_name>": "<protected_value>",
    "signatures": {
        "<entity_name>": {
            "ed25519:<key_id>": "<unpadded_base64_signature>"
        }
    },
    "unsigned": {
        "<unprotected_name>": "<unprotected_value>",
    }
}

Release files for signedjson 1.1.4

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

Source distribution (sdist)

Source distribution for signedjson 1.1.4
File Size Uploaded
signedjson-1.1.4.tar.gz 13.6 kB Details

Built distribution (wheel)

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

Total release size: 24.2 kB

Release files / signedjson-1.1.4.tar.gz

Download URL signedjson-1.1.4.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cd91c56af53f169ef032c62e9c4a3292dc158866933318d0592e3462db3d6492
BLAKE2b-256 checksum
How to use checksums
8e3b614317881125d7c9d582cf54d81f537cfb52c81c4fc0177a1709f3d475d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

Release files / signedjson-1.1.4-py3-none-any.whl

Download URL signedjson-1.1.4-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45569ec54241c65d2403fe3faf7169be5322547706a231e884ca2b427f23d228
BLAKE2b-256 checksum
How to use checksums
6ca6fae4333170898827f4d7ff71bec4e79d75fb9d258ecb9a98ee77e38f4df8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

1 release file

1.1

1 release file

1.0.0

1 release file

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