Python Wrapper for TDF3 SDK
Project description
TDF3 SDK
The TDF3 Python SDK allows developers to easily create and manage encrypted Trusted Data Format (TDF) objects and interact with Key Access and Entity Attribute Services (KAS, EAS).
Installation
Upgrade pip3 to the latest version and run
pip3 install tdf3sdk
Authentication
tdf3sdk allows users to set authentication headers (OIDC bearer tokens, etc), and will use those for authenticating with backing services - by design it does not contain authentication flow logic, for example to exchange client credentials for OIDC bearer tokens, refresh expired tokens, etc - it expects callers to handle that.
For an example of how to wrap this library in auth provider flows, see virtru-tdf3-cpp
OIDC
- Provide KAS url, user id, and set the use_oidc flag to true:
client = TDF3Client(kas_url, user_id, use_oidc=True)
- Provide the TDF3Client instance with your valid, previously obtained/generated OIDC bearer token:
client.set_auth_header('eyJhbGciOiJSUzI1NiIsInR5cCIg...')
Legacy EAS
Two different methods:
- Provide EAS url and user id (user should be registered on EAS):
client = TDF3Client(eas_url, user_id)
- Provide EAS url, user id, client key (absolute file path), client cetificate (absolute file path) and root CA (absolute file path)
client = TDF3Client(eas_url, user_id, filepath_client_key, filepath_client_cert, filepath_rootCA)
Create Encrypted TDF Object (minimal example)
from tdf3sdk import TDF3Client
client = TDF3Client(eas_url, user_id)
unprotected_file = "sensitive.txt"
protected_file = unprotected_file + ".tdf.html"
client.encrypt_file(unprotected_file, protected_file)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for tdf3sdk-1.2.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0b6fb2b3b6bfab8e428f37d5b225bdd2a8835a0da9c03313c5dfbccfcc18524 |
|
MD5 | 14699b42265462aa93f7558fa874e5fe |
|
BLAKE2b-256 | a1b9b933e13624c80159874a255b13d6516fa25b02dbc4f3c4cba4c2d1959625 |
Hashes for tdf3sdk-1.2.7-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2017f94023112a04db93cc40df367cd776d9e90945039dcfde8cc15c5e50d6fd |
|
MD5 | 97a010de17466d4cd2a1b4c0d04421b4 |
|
BLAKE2b-256 | 17d451963f7dd6b8dc4a400d295be619532719f142a41101f2554555554d272f |
Hashes for tdf3sdk-1.2.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53056b032510bf2aa770bdcb54c96f30c0ea3359b01f0bb3fea6b30d102e3611 |
|
MD5 | 0480ca6a358e94c0d2393d30e4c1dc7b |
|
BLAKE2b-256 | ec1364e7083b8eb6d811dc96d3128e16b6d36b3aecebf24fde3f7efcc574a1a6 |
Hashes for tdf3sdk-1.2.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a657f8f227348614b0fe56f44fea5697583fb82bc4e5290b809133affbf8e297 |
|
MD5 | 27114caf9e3aa4fb994e8a11fac68ebe |
|
BLAKE2b-256 | fa58c1321342848ec6182fe87651854a31474d9ef9b85ed884f30a66e01bdda6 |
Hashes for tdf3sdk-1.2.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd0d6a08f012c4ca978b435098111439d6a56ccce56ff303cc252ef2dd19cb16 |
|
MD5 | 5843db3c357ece702d3863a5e14f3f83 |
|
BLAKE2b-256 | edf963e276749fce966cf424c30c3f5424ff13f2bd4ea5e3b1492623e3f695b9 |
Hashes for tdf3sdk-1.2.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c1443f647129ad559b09a0f18a7474032837b58ec9557f7ff76cc135a60b4c |
|
MD5 | 125ce38b1d7ffed5d39204fee5c7f99a |
|
BLAKE2b-256 | 8ad7e4a74ce90accf2e5f9de6065750a4ca2b7a3fbf170d3b9dc460f0702f02c |
Hashes for tdf3sdk-1.2.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b892ecf26864f07219d4c2115acd8e8f5c6451565648079a440b3a6985b2cd1 |
|
MD5 | 3eef966978f1d2720658030b7c451bc1 |
|
BLAKE2b-256 | ef89b95e3fe755696dabd4fc17fb9a6113940e5c66c7f529dc8cf096c519b07a |
Hashes for tdf3sdk-1.2.7-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7a48fd66ae12214f40359fc03310fa9df1449b2a322b0080aaf30a31e48688f |
|
MD5 | 014eb7d0cfa99fd309e478bb71d7e1a0 |
|
BLAKE2b-256 | c01ec78a04cae7dc9a4d46ebfc3d500b356d8427b5a38c62c946e5d809baa484 |
Hashes for tdf3sdk-1.2.7-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a92ebef8809369f12eb95daaf999368f682dc418665f3df298ee007bbc0c333 |
|
MD5 | 7d4f3997509cb9cdff912f7719fdef4f |
|
BLAKE2b-256 | 35b747bb6d7be9654e5c7a9dcd9e8687e050eb7ea036e34e7c2cf8beb0dc0042 |
Hashes for tdf3sdk-1.2.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2204d938f045c726ad585e885766a30a562457864b5bc185b338abc2c7be8fd6 |
|
MD5 | f9bba57e4c3b76d2f48c024f3a9067a5 |
|
BLAKE2b-256 | 5c853a41daab1f45ff47950ef62245240397b6a0963068058c842a92b106c3b7 |