From 66cff37a210bdbc025db1e853bbb9caf2502457b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jun 2020 21:32:57 +0100 Subject: [PATCH] Simplify --- jsonldsig.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/jsonldsig.py b/jsonldsig.py index f2fad5d1..c47a9c58 100644 --- a/jsonldsig.py +++ b/jsonldsig.py @@ -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 + return signedJldDocument