forked from indymedia/epicyon
Simplify
parent
6a74fcc7af
commit
66cff37a21
11
jsonldsig.py
11
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
|
||||
|
|
Loading…
Reference in New Issue