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)
|
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
|
|
||||||
|
|
Loading…
Reference in New Issue