{"id":15569228,"url":"https://github.com/mosquito/pyjwt-rsa","last_synced_at":"2025-09-08T13:38:43.726Z","repository":{"id":55530105,"uuid":"129727591","full_name":"mosquito/pyjwt-rsa","owner":"mosquito","description":"Helpers for JWT tokens with RSA.","archived":false,"fork":false,"pushed_at":"2025-01-06T09:35:38.000Z","size":84,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:22:26.212Z","etag":null,"topics":["cli","clt","jwt","pyjwt","python","rsa","useful"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mosquito.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-16T10:45:02.000Z","updated_at":"2025-01-31T02:39:17.000Z","dependencies_parsed_at":"2022-08-15T02:40:24.419Z","dependency_job_id":null,"html_url":"https://github.com/mosquito/pyjwt-rsa","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosquito%2Fpyjwt-rsa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosquito%2Fpyjwt-rsa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosquito%2Fpyjwt-rsa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosquito%2Fpyjwt-rsa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mosquito","download_url":"https://codeload.github.com/mosquito/pyjwt-rsa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074960,"owners_count":21043501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","clt","jwt","pyjwt","python","rsa","useful"],"created_at":"2024-10-02T17:23:13.449Z","updated_at":"2025-04-09T17:21:07.165Z","avatar_url":"https://github.com/mosquito.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PyJWT RSA Helper\n================\n\n\nHelpers for JWT tokens with RSA.\n\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from jwt_rsa.token import JWT\n    \u003e\u003e\u003e from jwt_rsa.rsa import generate_rsa\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e bits = 2048\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e private_key, public_key = generate_rsa(bits)\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e jwt = JWT(private_key, public_key)\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e token = jwt.encode(foo='bar')\n    \u003e\u003e\u003e result = jwt.decode(token)\n    \u003e\u003e\u003e result\n    {'foo': 'bar', 'exp': 1525941819.638339, 'nbf': 1523349799.638342}\n    \u003e\u003e\u003e # Expired token\n    \u003e\u003e\u003e token = jwt.encode(foo='bar', expired=-1)\n    \u003e\u003e\u003e jwt.decode(token)\n    Traceback (most recent call last):\n    ...\n    jwt.exceptions.ExpiredSignatureError: Signature has expired\n    \u003e\u003e\u003e # No verify token signature and expiration\n    \u003e\u003e\u003e jwt.decode(token, verify=False)\n    {'foo': 'bar', 'exp': -1, 'nbf': 1523350046.935803}\n\n\nCommand line utilities\n----------------------\n\nModule provides following utilities\n\njwt-rsa-keygen\n++++++++++++++\n\nCreates a new key pair:\n\n.. code-block::\n\n   $ jwt-rsa-keygen -h                                                                                                                                                                                              ±8 ?3 master\n   usage: jwt-rsa-keygen [-h] [-b BITS] [-P]\n\n   optional arguments:\n     -h, --help            show this help message and exit\n     -b BITS, --bits BITS\n     -P, --pem\n\n\nBy default this utility return JSON-serialized key pair:\n\n.. code-block::\n\n   $ jwt-rsa-keygen                                                                                                                                                                                                 ±8 ?3 master\n   {\n      \"private\": \"MIIEvgIBADANBg......h3MBsSzx\",\n      \"public\": \"MIIBCgKCAQEAxUU......5niBEjAB\"\n   }\n\nAdd parameter `-P` for return in PEM format:\n\n.. code-block::\n\n   $ jwt-rsa-keygen -P                                                                                                                                                                                              ±8 ?3 master\n   -----BEGIN PRIVATE KEY-----\n   MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDDeiI5V/O/Mbff\n   ...\n   LGQgWf5ch0t1+Rh3tjIuuSc=\n   -----END PRIVATE KEY-----\n\n   -----BEGIN RSA PUBLIC KEY-----\n   MIIBCgKCAQEAw3oiOVfzvzG331nAL5hGHbblcCaV3pbfoCiFRgwpNPf7snIJtw97\n   ...\n   3k2mMT1z6NFO6e6LMxg2zrqs3zgqwx5/9wIDAQAB\n   -----END RSA PUBLIC KEY-----\n\n\njwt-rsa-verify\n++++++++++++++\n\nVerify JSON serialized key pair:\n\n.. code-block::\n\n   $ jwt-rsa-keygen | jwt-rsa-verify                                                                                                                                                                                ±8 ?3 master\n   INFO:root:Awaiting JSON on stdin...\n   INFO:root:Signing OK\n   INFO:root:Verifying OK\n\nOr failed when key pair is invalid or doesn't match:\n\n.. code-block::\n\n   $ jwt-rsa-keygen | sed 's/M/j/' | jwt-rsa-verify                                                                                                                                                                 ±8 ?3 master\n   INFO:root:Awaiting JSON on stdin...\n   Traceback (most recent call last):\n     ...\n   ValueError: Could not deserialize key data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosquito%2Fpyjwt-rsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmosquito%2Fpyjwt-rsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosquito%2Fpyjwt-rsa/lists"}