|
17 | 17 | from prompt_toolkit.key_binding import KeyBindings |
18 | 18 | from prompt_toolkit.keys import Keys |
19 | 19 | from prompt_toolkit.filters import Condition |
20 | | -import ed25519 |
| 20 | +import nacl.signing |
21 | 21 |
|
22 | 22 | from .client import OnlyKey, Message, MessageField |
23 | 23 |
|
@@ -56,10 +56,10 @@ def prompt_pin(): |
56 | 56 |
|
57 | 57 | # Create a new private key |
58 | 58 | if sys.argv[2] == 'new': |
59 | | - signing_key, _ = ed25519.create_keypair() |
| 59 | + signing_key, _ = nacl.signing.SigningKey.generate() |
60 | 60 |
|
61 | 61 | with open('ecc_private.key', 'wb+') as f: |
62 | | - f.write(signing_key.to_seed()) |
| 62 | + f.write(signing_key.encode(encoder=nacl.encoding.HexEncoder)) |
63 | 63 |
|
64 | 64 | print('ECC private key written to ecc_private.key') |
65 | 65 |
|
@@ -307,7 +307,7 @@ def prompt_pin(): |
307 | 307 | else: |
308 | 308 |
|
309 | 309 | # Print help. |
310 | | - print('OnlyKey CLI v1.1.0') |
| 310 | + print('OnlyKey CLI v1.2.0') |
311 | 311 | print('Control-D to exit.') |
312 | 312 | print() |
313 | 313 |
|
@@ -353,7 +353,7 @@ def mprompt(): |
353 | 353 | print(only_key.read_string() + ' for second profile') |
354 | 354 | only_key.send_message(msg=msg) |
355 | 355 | print(only_key.read_string()) |
356 | | - print |
| 356 | + print () |
357 | 357 | input('Press the Enter key once you are done') |
358 | 358 | only_key.send_message(msg=msg) |
359 | 359 | print(only_key.read_string()) |
@@ -567,6 +567,3 @@ def main(): |
567 | 567 | print() |
568 | 568 | print('Bye!') |
569 | 569 | pass |
570 | | - |
571 | | -if __name__ == "__main__": |
572 | | - main() |
0 commit comments