mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 21:28:29 +03:00
Further WIP - currently working on verify_signed
This commit is contained in:
@@ -15,15 +15,21 @@ def digicert():
|
||||
def test_sign_data(setup_module):
|
||||
tsa_url = "http://timestamp.identrust.com"
|
||||
tsp: TimestampingEnricher = setup_module("timestamping_enricher")
|
||||
|
||||
data = b"4b7b4e39f12b8c725e6e603e6d4422500316df94211070682ef10260ff5759ef"
|
||||
result: TimeStampResponse = tsp.sign_data(tsa_url, data)
|
||||
assert isinstance(result, TimeStampResponse)
|
||||
|
||||
|
||||
try:
|
||||
tsp.verify_signed(result, data)
|
||||
valid_root = tsp.verify_signed(result, data)
|
||||
assert valid_root.subject == "CN=Entrust Root Certification Authority - G2, OU=(c) 2009 Entrust, Inc. - for authorized use only, OU=See www.entrust.net/legal-terms, O=Entrust, Inc., C="
|
||||
except Exception as e:
|
||||
pytest.fail(f"Verification failed: {e}")
|
||||
|
||||
# test downloading the cert
|
||||
cert_chain = tsp.download_and_verify_certificate(result)
|
||||
|
||||
def test_tsp_enricher_download_syndication(setup_module, digicert):
|
||||
tsp: TimestampingEnricher = setup_module("timestamping_enricher")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user