main
Bob Mottram 2020-06-15 21:32:57 +01:00
parent 6a74fcc7af
commit 66cff37a21
1 changed files with 5 additions and 6 deletions

View File

@ -137,13 +137,12 @@ def jsonldVerify(signedJldDocument: {}, publicKeyPem: str) -> bool:
return verifyJws(normalizedJldHash, jwsSignature, publicKeyPem)
def testSignJsonld(jldDocument: {}, privateKeyPem: str,
expectedJldDocumentSigned=None):
def testSignJsonld(jldDocument: {}, privateKeyPem: str) -> {}:
"""Creates a test signature
"""
signedJldDocument = jsonldSign(jldDocument, privateKeyPem)
# pop the created time key since its dynamic
signedJldDocument['signature'].pop('created')
if expectedJldDocumentSigned:
assert signedJldDocument == expectedJldDocumentSigned
else:
return signedJldDocument