Make the signature wrapped in JSON object to be able to extend structure later

This commit is contained in:
Ondrej Mikle 2017-10-27 19:56:43 +02:00
parent d4a382ed2f
commit cfe19b55a1
2 changed files with 16 additions and 3 deletions

View file

@ -27,7 +27,9 @@ try:
print "Got UID %s" % uid_hex
signature = signUid(key, uid_hex.decode("hex"))
(tempFd, tempFname) = tempfile.mkstemp(dir="/tmp")
os.write(tempFd, signature)
signatureJson = '{"brmdoorSignature": "%s"}' % signature.encode("hex")
print "Writing signature JSON:", signatureJson
os.write(tempFd, signatureJson)
os.close(tempFd)
print "Wrote signature into %s" % tempFname
except NFCError, e: