An IETF Time-Stamp Protocol (TSP) (RFC 3161) client
Project description
tsp-client is an implementation of the RFC 3161 TSP protocol in Python.
Installation
pip install tsp-client
Synopsis
from tsp_client import TSPSigner, TSPVerifier
# Sign a message online by transmitting its digest to the timestamp authority
message = b"abc"
signer = TSPSigner()
signed = signer.sign(message) # Returns raw bytes of the verified timestamp token.
# Verify a presented timestamp token offline using the original message
verified = TSPVerifier().verify(signed, message=message)
# Or verify using the message digest (digest algorithm may vary)
import hashlib
digest = hashlib.sha512(message).digest()
verified = TSPVerifier().verify(signed, message_digest=digest)
print(verified.tst_info) # Parsed TSTInfo (CMS SignedData) structure
print(verified.signed_attrs) # Parsed CMS SignedAttributes structure
Specifying a custom TSA
By default, tsp-client uses the DigiCert TSA server. To use a different TSA, set the SigningSettings.tsp_server attribute as follows:
from tsp_client import TSPSigner, TSPVerifier, SigningSettings
signing_settings = SigningSettings(tsp_server="http://tsa.quovadisglobal.com/TSS/HttpTspServer")
signer = TSPSigner()
signed = signer.sign(message, signing_settings=signing_settings)
Links
Bugs
Please report bugs, issues, feature requests, etc. on GitHub.
License
Licensed under the terms of the Apache License, Version 2.0.
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
tsp-client-0.1.0.tar.gz
(15.0 kB
view hashes)
Built Distribution
tsp_client-0.1.0-py3-none-any.whl
(11.5 kB
view hashes)
Close
Hashes for tsp_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7910d9633dd553dacfd0161a77e047289e36ccb9e18b791cf0e932feaea705a7 |
|
MD5 | 12c500b199fb619a2d9dd8fce83b6d1e |
|
BLAKE2b-256 | ef9de68d3174cff4683854c4f9b25a4de7d379cce44d75cd2e685c85757ec0c1 |