Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgtool getpub fails for ED25519 #1999

Closed
srkapil opened this issue Jul 10, 2024 · 4 comments
Closed

imgtool getpub fails for ED25519 #1999

srkapil opened this issue Jul 10, 2024 · 4 comments
Assignees

Comments

@srkapil
Copy link

srkapil commented Jul 10, 2024

I'm getting AttributeError: 'Ed25519' object has no attribute 'get_public_pem'. Did you mean: 'emit_public_pem'? when trying to get the public key for a ED25519 private key. I gnerated the private key using imgtool scripts/imgtool.py keygen -t ed25519 -k test-ed25519.pem and then tried to get the public key using command scripts/imgtool.py getpub -k test-ed25519.pem -e pem.

stack trace:

Traceback (most recent call last):
  File "/home/user/work/mcuboot/scripts/imgtool.py", line 22, in <module>
    main.imgtool()
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/work/mcuboot/scripts/imgtool/main.py", line 155, in getpub
    key.emit_public_pem(file=output)
  File "/home/user/work/mcuboot/scripts/imgtool/keys/general.py", line 106, in emit_public_pem
    print(str(self.get_public_pem(), 'utf-8'), file=file, end='')
AttributeError: 'Ed25519' object has no attribute 'get_public_pem'. Did you mean: 'emit_public_pem'?
@davidvincze
Copy link
Collaborator

Thank you for opening this issue, the method for exporting the pubkey in PEM format was missing for EC25519.
Fix is on its way.

@davidvincze
Copy link
Collaborator

@srkapil could you please review #2020?

@srkapil
Copy link
Author

srkapil commented Jul 27, 2024

@srkapil could you please review #2020?

Added a comment in PR.

@davidvincze
Copy link
Collaborator

The issue has been resolved by #2020.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants