mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-05 13:01:12 +00:00
tools: add getkey command to keyctl to retrieve the public key
This commit is contained in:
parent
b77a1eb12f
commit
5e164ebaf1
10
tools/keyctl
10
tools/keyctl
@ -29,6 +29,16 @@ def cli():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command(help='')
|
||||||
|
@click.argument('index', type=click.Choice(indexmap.keys()))
|
||||||
|
def getkey(index):
|
||||||
|
index = indexmap[index]
|
||||||
|
t = get_trezor()
|
||||||
|
path = "10018'/%d'" % index
|
||||||
|
node = t.get_public_node(t.expand_path(path), ecdsa_curve_name='ed25519').node
|
||||||
|
print('%s' % (binascii.hexlify(node.public_key[1:]).decode()))
|
||||||
|
|
||||||
|
|
||||||
@cli.command(help='')
|
@cli.command(help='')
|
||||||
@click.argument('index', type=click.Choice(indexmap.keys()))
|
@click.argument('index', type=click.Choice(indexmap.keys()))
|
||||||
@click.argument('filename')
|
@click.argument('filename')
|
||||||
|
Loading…
Reference in New Issue
Block a user