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) return verifyJws(normalizedJldHash, jwsSignature, publicKeyPem)
def testSignJsonld(jldDocument: {}, privateKeyPem: str, def testSignJsonld(jldDocument: {}, privateKeyPem: str) -> {}:
expectedJldDocumentSigned=None): """Creates a test signature
"""
signedJldDocument = jsonldSign(jldDocument, privateKeyPem) signedJldDocument = jsonldSign(jldDocument, privateKeyPem)
# pop the created time key since its dynamic # pop the created time key since its dynamic
signedJldDocument['signature'].pop('created') signedJldDocument['signature'].pop('created')
if expectedJldDocumentSigned: return signedJldDocument
assert signedJldDocument == expectedJldDocumentSigned
else:
return signedJldDocument