ehn-dcc-development / ehn-sign-verify-python-trivial

Extremely minimal python implementation of the eHN-S protocol.
European Union Public License 1.2
76 stars 41 forks source link

ModuleNotFoundError: No module named 'cose.curves' #9

Open JsBergbau opened 3 years ago

JsBergbau commented 3 years ago

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?

nofaceinbook commented 3 years ago

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

jschlyter commented 3 years ago

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.