Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The key generation example in this repo is not working any more #18

Open
@FoamyGuy

Description

@FoamyGuy

It raises this exception:

writing RSA key
Traceback (most recent call last):
  File "Adafruit_CircuitPython_JWT/examples/jwt_simpletest_secrets.py", line 37, in <module>
    pk = rsa.PrivateKey.load_pkcs1(private_key)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".cpy_venv/lib/python3.12/site-packages/rsa/key.py", line 125, in load_pkcs1
    return method(keyfile)
           ^^^^^^^^^^^^^^^
  File ".cpy_venv/lib/python3.12/site-packages/rsa/key.py", line 612, in _load_pkcs1_pem
    der = rsa.pem.load_pem(keyfile, b"RSA PRIVATE KEY")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".cpy_venv/lib/python3.12/site-packages/rsa/pem.py", line 103, in load_pem
    pem_lines = [line for line in _pem_lines(contents, pem_start, pem_end)]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".cpy_venv/lib/python3.12/site-packages/rsa/pem.py", line 77, in _pem_lines
    raise ValueError('No PEM start marker "%r" found' % pem_start)
ValueError: No PEM start marker "b'-----BEGIN RSA PRIVATE KEY-----'" found

The private key that was generated begins with -----BEGIN PRIVATE KEY-----, note the lack of "RSA". I'm guessing that my version of openssl is newer than what this example or the library it uses were written for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions