jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
4.99k stars 676 forks source link

jwk_from_pem not found in jwt #962

Closed crspencer11 closed 3 days ago

crspencer11 commented 3 days ago

When attempting to apply the jwk_from_pem function, I get an error.

Expected Result

A newly created signing key based on my pem file key.

Actual Result

Error output: "cannot import name 'jwk_from_pem' from 'jwt'"

Reproduction Steps

from jwt import jwk_from_pem
...
signing_key = jwk_from_pem(pem_file.read())

System Information

$ python -m jwt.help
{
  "cryptography": {
    "version": ""
  },
  "implementation": {
    "name": "CPython",
    "version": "3.12.4"
  },
  "platform": {
    "release": "23.4.0",
    "system": "Darwin"
  },
  "pyjwt": {
    "version": "2.8.0"
  }
}

I assume it stems from my Python version not being supported or having this feature.

jpadilla commented 3 days ago

that https://pypi.org/project/jwt/ is not this https://pypi.org/project/pyjwt/