timestamping_enricher.timestamping_enricher#
Module Contents#
- class timestamping_enricher.timestamping_enricher.TimestampingEnricher#
Bases:
auto_archiver.core.EnricherUses several RFC3161 Time Stamp Authorities to generate a timestamp token that will be preserved. This can be used to prove that a certain file existed at a certain time, useful for legal purposes, for example, to prove that a certain file was not tampered with after a certain date.
The information that gets timestamped is concatenation (via paragraphs) of the file hashes existing in the current archive. It will depend on which archivers and enrichers ran before this one. Inner media files (like thumbnails) are not included in the .txt file. It should run AFTER the hash_enricher.
See https://gist.github.com/Manouchehri/fd754e402d98430243455713efada710 for list of timestamp authorities.
- session = None#
- setup()#
- cleaup() None#
Terminates the underlying network session.
- enrich(to_enrich: auto_archiver.core.Metadata) None#
Enriches a Metadata object with additional information or context.
Takes the metadata object to enrich as an argument and modifies it in place, returning None.
- save_timestamp_token(timestamp_token: bytes, tsa_url: str) str#
Takes a timestamp token, and saves it to a file with the TSA URL as part of the filename.
- verify_signed(timestamp_response: rfc3161_client.TimeStampResponse, message: bytes) cryptography.x509.Certificate#
Verify a Signed Timestamp Response is trusted by a known Certificate Authority.
- Parameters:
timestamp_response (TimeStampResponse) – The signed timestamp response.
message (bytes) – The message that was timestamped.
- Returns:
A valid root certificate that was used to sign the timestamp response, or None
- Return type:
x509.Certificate
- Raises:
ValueError – If no valid root certificate was found in the trusted root store.
- sign_data(tsa_url: str, bytes_data: bytes) rfc3161_client.TimeStampResponse#
- tst_certs(tsp_response: rfc3161_client.TimeStampResponse)#
- save_certificate(tsp_response: rfc3161_client.TimeStampResponse, verified_root_cert: cryptography.x509.Certificate) list[auto_archiver.core.Media]#