ehn-sign-verify-python-trivial icon indicating copy to clipboard operation
ehn-sign-verify-python-trivial copied to clipboard

ModuleNotFoundError: No module named 'cose.curves'

Open JsBergbau opened this issue 3 years ago • 2 comments

Trying to execute echo "{'A': 1234}" | python3 hc1_sign.py | python3 hc1_verify.py this error occurs

Traceback (most recent call last):
  File "/home/pi/ehn-sign-verify-python-trivial/hc1_sign.py", line 13, in <module>
    from cose.curves import P256
ModuleNotFoundError: No module named 'cose.curves'
Traceback (most recent call last):
  File "/home/pi/ehn-sign-verify-python-trivial/hc1_verify.py", line 16, in <module>
    from cose.curves import P256
ModuleNotFoundError: No module named 'cose.curves'

Of course module is installed via pip3 install cose What is wrong here?

JsBergbau avatar Jun 24 '21 10:06 JsBergbau

Hi @JsBergbau, I run into the same issue. Seems the cose library was reorganized with new version. So with new cose library you should include P256 like this: from cose.keys.curves import P256

nofaceinbook avatar Jun 24 '21 12:06 nofaceinbook

See also https://github.com/ehn-dcc-development/python-hcert for a ready to use library. Not yet on PyPi, but I'm happy to publish it if requested.

jschlyter avatar Jun 24 '21 12:06 jschlyter