Byte encoding
* More string updates. * verifydetails.py still fails, but as Bernhard is still contactable, it might be worth him checking on it instead.
This commit is contained in:
parent
0e6e6689ef
commit
c39cea7a07
@ -22,10 +22,10 @@ from pyme.constants.sig import mode
|
|||||||
|
|
||||||
core.check_version(None)
|
core.check_version(None)
|
||||||
|
|
||||||
plain = core.Data("Test message")
|
plain = core.Data(b"Test message")
|
||||||
sig = core.Data()
|
sig = core.Data()
|
||||||
c = core.Context()
|
c = core.Context()
|
||||||
c.set_passphrase_cb(callbacks.passphrase_stdin, 'for signing')
|
c.set_passphrase_cb(callbacks.passphrase_stdin, b'for signing')
|
||||||
c.op_sign(plain, sig, mode.CLEAR)
|
c.op_sign(plain, sig, mode.CLEAR)
|
||||||
sig.seek(0,0)
|
sig.seek(0,0)
|
||||||
print(sig.read())
|
print(sig.read())
|
||||||
|
@ -25,10 +25,10 @@ from pyme.constants.sig import mode
|
|||||||
|
|
||||||
core.check_version(None)
|
core.check_version(None)
|
||||||
|
|
||||||
plain = core.Data("Test message")
|
plain = core.Data(b"Test message")
|
||||||
sig = core.Data()
|
sig = core.Data()
|
||||||
c = core.Context()
|
c = core.Context()
|
||||||
user = "joe@example.org"
|
user = b"joe@example.org"
|
||||||
|
|
||||||
c.signers_clear()
|
c.signers_clear()
|
||||||
# Add joe@example.org's keys in the list of signers
|
# Add joe@example.org's keys in the list of signers
|
||||||
@ -41,7 +41,7 @@ if not c.signers_enum(0):
|
|||||||
|
|
||||||
# This is a map between signer e-mail and its password
|
# This is a map between signer e-mail and its password
|
||||||
passlist = {
|
passlist = {
|
||||||
"<joe@example.org>": "Crypt0R0cks"
|
b"<joe@example.org>": b"Crypt0R0cks"
|
||||||
}
|
}
|
||||||
|
|
||||||
# callback will return password based on the e-mail listed in the hint.
|
# callback will return password based on the e-mail listed in the hint.
|
||||||
|
@ -51,7 +51,7 @@ else:
|
|||||||
c = Context()
|
c = Context()
|
||||||
c.set_passphrase_cb(lambda x,y,z: "abc")
|
c.set_passphrase_cb(lambda x,y,z: "abc")
|
||||||
out = Data()
|
out = Data()
|
||||||
c.op_keylist_start("Alpha", 0)
|
c.op_keylist_start(b"Alpha", 0)
|
||||||
key = c.op_keylist_next()
|
key = c.op_keylist_next()
|
||||||
c.op_edit(key, KeyEditor().edit_fnc, out, out)
|
c.op_edit(key, KeyEditor().edit_fnc, out, out)
|
||||||
print("[-- Last response --]")
|
print("[-- Last response --]")
|
||||||
|
@ -86,13 +86,13 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if argc == 2:
|
if argc == 2:
|
||||||
print("trying to verify file: " + sys.argv[1])
|
print("trying to verify file: " + sys.argv[1].encode('utf-8'))
|
||||||
verifyprintdetails(sys.argv[1])
|
verifyprintdetails(sys.argv[1].encode('utf-8'))
|
||||||
if argc == 3:
|
if argc == 3:
|
||||||
print("trying to verify signature %s for file %s" \
|
print("trying to verify signature %s for file %s" \
|
||||||
% (sys.argv[1], sys.argv[2]))
|
% (sys.argv[1].encode('utf-8'), sys.argv[2].encode('utf-8')))
|
||||||
|
|
||||||
verifyprintdetails(sys.argv[1], sys.argv[2])
|
verifyprintdetails(sys.argv[1].encode('utf-8'), sys.argv[2].encode('utf-8'))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user