Skip to main content

OpenToken support for python.

Project description

opentoken-python

Contributor Covenant

OpenToken support for Python.

A Python implementation of generating and parsing OpenTokens. Much of this implementation is borrowed from node-opentoken.

https://tools.ietf.org/html/draft-smith-opentoken-02

Usage

Create an opentoken string:

from opentoken import OpenToken

otkapi = OpenToken("your_password")
otkapi.create_token([
    ("subject", "foobar"),
    ("key2", "val2")
])

Parse an opentoken string:

otkapi = OpenToken("your_password")
otkapi.parse_token("your_base64_encoded_token_string")

OpenToken constructor

password: Defaults to None.

cipher_suite_id: Defaults to 2. Possible ids are 0 - no encryption, 1 - AES-256, 2 - AES-128, and 3 - 3DES-168.

token_tolerance: Defaults to 120 seconds.

token_lifetime: Defaults to 300 seconds.

token_renewal: Defaults to 12 hours.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Project details


Download files

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

Files for opentoken, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size opentoken-2.0.0-py3-none-any.whl (7.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size opentoken-2.0.0.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page