title: Could not deserialize key data on decoding JWT python
body: <p>I am using <a href="https://pyjwt.readthedocs.io" rel="noreferrer">pyjwt</a> library for decoding the JWT token. I got this error when I am decoding. The code was given in the documantation.</p>
  
  <pre><code>import jwt
  
  encoded_jwt='''eyJ0eXAiOiJKV1QiLCJhbG......'''
  secret=b''''-----BEGIN PUBLIC KEY-----
  MIIFRjCCBC6gAwIBAgIQCIdSGhpikQCjOIY154XoqzANBgkqhkiG9w0BAQsFADBN
  ......
  -----END PUBLIC KEY-----'''
  
  print(jwt.decode(encoded_jwt, secret , algorithms=['RS256']))
  </code></pre>
  
  <blockquote>
    <p>raise ValueError("Could not deserialize key data.") ValueError: Could
    not deserialize key data.</p>
  </blockquote>
  
  <p>Could You please help me in resolving it beacuse when I use this it in the <a href="https://jwt.io/" rel="noreferrer">JWT</a> website it's working.</p>
  
  <p>This is the full error log..</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File
    "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/jwt/algorithms.py",
    line 205, in prepare_key
        key = load_pem_private_key(key, password=None, backend=default_backend())   File
    "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/primitives/serialization.py",
    line 20, in load_pem_private_key
        return backend.load_pem_private_key(data, password)   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py",
    line 1014, in load_pem_private_key
        password,   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py",
    line 1233, in _load_key
        self._handle_key_loading_error()   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py",
    line 1291, in _handle_key_loading_error
        raise ValueError("Could not deserialize key data.") ValueError: Could not deserialize key data.</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>Traceback (most recent call last):   File
    "/home/sathiyakugan/PycharmProjects/JWTsample/sample.py", line 45, in
    
        print(jwt.decode(encoded_jwt, secret , algorithms=['RS256']))   File
    "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/jwt/api_jwt.py",
    line 93, in decode
        jwt, key=key, algorithms=algorithms, options=options, **kwargs   File
    "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/jwt/api_jws.py",
    line 157, in decode
        key, algorithms)   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/jwt/api_jws.py",
    line 221, in _verify_signature
        key = alg_obj.prepare_key(key)   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/jwt/algorithms.py",
    line 207, in prepare_key
        key = load_pem_public_key(key, backend=default_backend())   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/primitives/serialization.py",
    line 24, in load_pem_public_key
        return backend.load_pem_public_key(data)   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py",
    line 1040, in load_pem_public_key
        self._handle_key_loading_error()   File "/home/sathiyakugan/PycharmProjects/Python/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py",
    line 1291, in _handle_key_loading_error
        raise ValueError("Could not deserialize key data.") ValueError: Could not deserialize key data.</p>
    
    <p>Process finished with exit code 1</p>
  </blockquote>