Skip to content

Unable to load eddsa key #476

@pavriet-boxtal

Description

@pavriet-boxtal

Hi, I'm trying to load an eddsa ed25519 key with PGPKey.from_blob method, but it's raising a pgpy.errors.PGPError: 14 is not a valid HashAlgorithm exception.

Key is valid as I was able to load it with the os gpg command.

I have no idea what is going on. I check the doc and here it says that eddsa is implemented ? https://pgpy.readthedocs.io/en/latest/progress.html?highlight=eddsa

python 3.11.1
pgpy 0.6.0

  File "/home/user/.cache/pypoetry/virtualenvs/venv/lib/python3.11/site-packages/pgpy/types.py", line 195, in from_blob
    po = obj.parse(bytearray(blob, 'latin-1'))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/venv/lib/python3.11/site-packages/pgpy/pgp.py", line 2647, in parse
    [ operator.ior(pgpobj, PGPSignature() | sig) for sig in group if not isinstance(sig, Opaque) ]
  File "/home/user/.cache/pypoetry/virtualenvs/venv/lib/python3.11/site-packages/pgpy/pgp.py", line 2647, in <listcomp>
    [ operator.ior(pgpobj, PGPSignature() | sig) for sig in group if not isinstance(sig, Opaque) ]
  File "/home/user/.cache/pypoetry/virtualenvs/venv/lib/python3.11/site-packages/pgpy/pgp.py", line 2617, in _getpkt
    return Packet(d) if d else None
           ^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/venv/lib/python3.11/site-packages/pgpy/types.py", line 542, in __call__
    raise PGPError(str(ex)) from ex
pgpy.errors.PGPError: 14 is not a valid HashAlgorithm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions