Skip to main content

Python Wrapper for openTDF SDK

Project description

OpenTDF SDK

The OpenTDF Python SDK allows developers to easily create and manage encrypted Trusted Data Format (TDF) objects and interact with Key Access and Attribute Provider services (KAS, AP).

Installation

Upgrade pip3 to the latest version and run

pip3 install opentdf

Backend services

To perform any TDF operation, first start the backend services. Follow the opentdf backend instructions here to get going quickly.

Authentication

The OpenTDF team has chosen Keycloak as its reference implementation IdP.

The OpenTDF SDK uses OIDC as authentication and authorization to verify the client has access on behalf of an entity or the a certain level of access appropriate to its subject attributes. The opentdf SDK currently supports only client attributes, not user or person entity attributes. First, create a client application in keycloak

Use the client creds to create an OIDCCredentials instance and pass into the TDFClientBase or NanoTDFClient. With the client initialized as such, you can use it to perform encrypt/decrypt operations on behalf of the assigned client profile.

Access control

OpenTDF enables the access control of the data by enabling attributes. The key access ABAC backend service can be used to add and remove attribute values to the client application.

Applying a data attribute to the TDF can be done using this SDK api.

client.add_data_attribute("https://example.com/attr/Classification/value/S", "Classification", "optionalKasKey", "optionalKasUrl")

Create TDF Object (minimal example)

from opentdf import TDFClientBase

oidc_creds = OIDCCredentials()
oidc_creds.set_client_credentials(client_id = "tdf-client",
                                 client_secret = "123-456",
                                 organization_name = "tdf",
                                 oidc_endpoint = "https://localhost:8443")

client = TDFClientBase(oidc_credentials = oidc_creds, kas_url = 'http://localhost:8080/kas')

client.encrypt_file("sensitive.txt", "sensitive.txt.tdf")
client.decrypt_file("sensitive.txt.tdf", "sensitive_plain.txt")

Terms of Service Privacy Policy

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

opentdf-0.2.11a1624-cp310-cp310-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.10 Windows x86-64

opentdf-0.2.11a1624-cp39-cp39-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

opentdf-0.2.11a1624-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

opentdf-0.2.11a1624-cp39-cp39-macosx_10_14_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

opentdf-0.2.11a1624-cp38-cp38-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

opentdf-0.2.11a1624-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

opentdf-0.2.11a1624-cp38-cp38-macosx_10_14_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

opentdf-0.2.11a1624-cp37-cp37m-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.7m Windows x86-64

opentdf-0.2.11a1624-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

opentdf-0.2.11a1624-cp37-cp37m-macosx_10_14_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

opentdf-0.2.11a1624-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file opentdf-0.2.11a1624-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4bfcc1ea65a00f5884cd4ed1c2c76c51096041ac71cbd9327b4e1cfd9d13e4a8
MD5 37e0aad1ebd3218f4c6582899d7cc74a
BLAKE2b-256 258b5226294adf27aca3457b628ad355a5a326eb2e803788ecac8f3c5a26f8c8

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6a937677fda1b2f1ab1289b9de8c09aaf6843dee4add6dd50a2dd2ce1fe1f2c1
MD5 059ace90a12d68f2b6c1104a7666face
BLAKE2b-256 5d29c25a7b7bb3efd0424433b3c4d0b3e78ce3a9c4e1344ab843740d1378a702

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for opentdf-0.2.11a1624-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c3cf88709c3fdd999da4915100bff5a2352e1251033205b98ccc86ecd052e07
MD5 ec16fee5691bf6e745ba30e2478808e6
BLAKE2b-256 c9e2edfb8a5b362a1e01d263b096d15bfe18ab342604e14f70743de7876e156a

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7ca08b6dd30d01877db5464dbe5610dabe31c5d7cc7bc9a6c0de74334f8cee04
MD5 3200f1e63029d2df06878be10af6c231
BLAKE2b-256 1efeb6d104bc30f7bb4a628e6e5c1cd03d127221992de7f926649a0157a78a65

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 422acc81fa732aa0131fc89543d38adf1e9ffa2cacefeeea5eec5aa7410bd3f9
MD5 e40c1a08a5ed3249ea0d757908c4958e
BLAKE2b-256 870c281418a250181963cfb8a31c4106cefa03b625e2cd204a32b4c45ee9dc2a

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for opentdf-0.2.11a1624-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff010901f01f10a80e48228ceb9aa9fdcc4c7678a005c580728fbdd6f8ba416a
MD5 f12fe3ff053c0ad6216fd174c042b28a
BLAKE2b-256 312ec4287f37cf301a04c7874da17ba1c0e96d837a116e120c985c83ef6ec010

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 af43bac92b223777aca0c2bb2c61aac8dc85e14d6cf30a39f57c4076d1793c93
MD5 9bac2f110b74e86b0ff55994e1bb81fc
BLAKE2b-256 cdfeee0a6f3d1e59a7434ec84a08c749273ab5c8f21d3058ca048911351e5eaa

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 be2ae9b931f304b6d647e2dac2f9d2d52bc3912b5c1478d1588894e6d2866cd5
MD5 1ac5bb8c5193b2e53471bf3fc2eb5121
BLAKE2b-256 010c4b77b7321e4d22abfb09908e24666f6aa06d185e6fdd56f25b144338221f

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for opentdf-0.2.11a1624-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77a586cb6c2cd237da1734ebfd0d6eb5cf98c8eee9e8dace2339962f7b919fb8
MD5 a83d9f3038ce7bee17b2d2c88f8d46d7
BLAKE2b-256 cec1ca6e281ca96c3e1a46e08b9301b6c0bf5787d066a46a021d278f072d3eb6

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: opentdf-0.2.11a1624-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for opentdf-0.2.11a1624-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 43e94f66046b143f0dd2c9d9c0e770495cbfa6b9034027b887ad0212fb993543
MD5 07f4eaa9a92493e4d33626c64e6b336a
BLAKE2b-256 e47da7e0a37c035042c902227885ed660da074bc9c8abb6b5400e47f17bd9373

See more details on using hashes here.

File details

Details for the file opentdf-0.2.11a1624-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for opentdf-0.2.11a1624-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e54c14bf8075128e0d1695ac86c902d1beeddbd74db53f045ab4569ec592d33f
MD5 4f1d53a4f287d8323d44fa04092962f6
BLAKE2b-256 25054caafd37aade309effd6b9ac351e012520c82a10f2736b21d3a3a1c835c6

See more details on using hashes here.

Supported by

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