Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tdf3sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tdf3sdk

Python Wrapper for TDF3 SDK

  • 1.2.7
  • PyPI
  • Socket score

Maintainers
1

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

  1. Provide KAS url, user id, and set the use_oidc flag to true:
client = TDF3Client(kas_url, user_id, use_oidc=True)
  1. Provide the TDF3Client instance with your valid, previously obtained/generated OIDC bearer token:
client.set_auth_header('eyJhbGciOiJSUzI1NiIsInR5cCIg...')

Legacy EAS

Two different methods:

  1. Provide EAS url and user id (user should be registered on EAS):
client = TDF3Client(eas_url, user_id)
  1. 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)

Terms of Service Privacy Policy

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc