Skip to content

Commit

Permalink
Sync tests
Browse files Browse the repository at this point in the history
Signed-off-by: steve lasker <[email protected]>
  • Loading branch information
SteveLasker committed Jul 22, 2024
1 parent feddff7 commit 486a5a1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions unittests/test_create_hashed_signed_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
HEADER_LABEL_CWT_CNF,
HEADER_LABEL_CNF_COSE_KEY,
HEADER_LABEL_PAYLOAD_HASH_ALGORITHM,
HEADER_LABEL_LOCATION,
HEADER_LABEL_PAYLOAD_LOCATION,
)

from .constants import KNOWN_STATEMENT
Expand All @@ -47,10 +47,15 @@ def test_sign_and_verify_statement(self):
subject = "testsubject"
issuer = "testissuer"
content_type = "application/json"
location_hint = "example-location"
payload_location = "example-location"

signed_statement = create_hashed_signed_statement(
signing_key, payload, subject, issuer, content_type, location_hint
signing_key=signing_key,
payload=payload,
subject=subject,
issuer=issuer,
content_type=content_type,
payload_location=payload_location
)

# decode the cbor encoded cose sign1 message
Expand All @@ -63,7 +68,7 @@ def test_sign_and_verify_statement(self):
self.assertEqual(
-16, message.phdr[HEADER_LABEL_PAYLOAD_HASH_ALGORITHM]
) # -16 for sha256
self.assertEqual(location_hint, message.phdr[HEADER_LABEL_LOCATION])
self.assertEqual(payload_location, message.phdr[HEADER_LABEL_PAYLOAD_LOCATION])

# get the verification key from cwt cnf
cwt = message.phdr[HEADER_LABEL_CWT]
Expand Down

0 comments on commit 486a5a1

Please sign in to comment.