Skip to main content

Library to offload some JWT crypto operations to KMS

Project description

Python jwt_kms library

This library is work in progress.

Isolating private asymmetric keys to AWS KMS helps improve security by making it next to impossible to make copies of them. This library aims to provide a simple interface to use KMS keys to sign payloads into JWS tokens and/or to encrypt payloads into JWE tokens.

Signing with RSA and EC keys is currently supported.

Keys

import boto3
from jwt_kms import jwk

client = boto3.client('kms')
key = jwk.JWK(client, 'some-key-id')

public_key_pem = key.public_key_pem

Signing

from jwt_kms import jws

payload = {
   'something': 'yes',
   'more_something': 'abc'
}

token = jws.JWS(payload).add_signature(key, 'RS256').serialize(compact=True)  # or compact=False

Encrypting

TODO.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwt_kms-0.1.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jwt_kms-0.1.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file jwt_kms-0.1.4.tar.gz.

File metadata

  • Download URL: jwt_kms-0.1.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.10-amd64

File hashes

Hashes for jwt_kms-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6185170479dc454b46013d99a7a75817605430c26ef3fc78ac1448e07065f60f
MD5 96abf25199ef7a9652cab5d3210a0ca6
BLAKE2b-256 1a3bd16c6bbe25602811f2d1a2984659dcebaed393daf922f60bed17d9caaafa

See more details on using hashes here.

File details

Details for the file jwt_kms-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: jwt_kms-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.10-amd64

File hashes

Hashes for jwt_kms-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 463597527117c81bc0899dd5c2231886b4744616160ba8d48ae25ae1944a7bb9
MD5 809d2caf6a7b0ae061ba7b6983185b22
BLAKE2b-256 9cd83aa18bb7d20d5bc3c1a51cc9748b31c2093350e160791d833081ebb1dbd4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page