mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 07:52:56 +01:00
dc5db01ff2
Signed-off-by: Schnuffle <schnuffle@github.com>
24 lines
528 B
Python
Executable file
24 lines
528 B
Python
Executable file
#!/usr/bin/env python2
|
|
|
|
import pymacaroons
|
|
import sys
|
|
|
|
if len(sys.argv) == 1:
|
|
sys.stderr.write("usage: %s macaroon [key]\n" % (sys.argv[0],))
|
|
sys.exit(1)
|
|
|
|
macaroon_string = sys.argv[1]
|
|
key = sys.argv[2] if len(sys.argv) > 2 else None
|
|
|
|
macaroon = pymacaroons.Macaroon.deserialize(macaroon_string)
|
|
print macaroon.inspect()
|
|
|
|
print ""
|
|
|
|
verifier = pymacaroons.Verifier()
|
|
verifier.satisfy_general(lambda c: True)
|
|
try:
|
|
verifier.verify(macaroon, key)
|
|
print "Signature is correct"
|
|
except Exception as e:
|
|
print str(e)
|