CryptoServe Client - API client for CryptoServe server
Project description
cryptoserve-client
API client for communicating with CryptoServe server.
Installation
pip install cryptoserve-client
Usage
from cryptoserve_client import CryptoClient
# Initialize client
client = CryptoClient(
server_url="https://api.cryptoserve.dev",
token="your-identity-token",
)
# Encrypt data
ciphertext = client.encrypt(b"sensitive data", context="user-pii")
# Decrypt data
plaintext = client.decrypt(ciphertext, context="user-pii")
# Check health
info = client.get_identity_info()
print(f"Identity: {info['name']}")
print(f"Contexts: {info['allowed_contexts']}")
Async Support
pip install cryptoserve-client[async]
from cryptoserve_client import AsyncCryptoClient
async def main():
async with AsyncCryptoClient(server_url, token) as client:
ciphertext = await client.encrypt(b"data", context="user-pii")
Error Handling
from cryptoserve_client import (
CryptoServeError,
AuthenticationError,
AuthorizationError,
ContextNotFoundError,
)
try:
client.encrypt(data, context="unknown")
except AuthorizationError:
print("Not authorized for this context")
except ContextNotFoundError:
print("Context doesn't exist")
License
Apache 2.0
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 Distribution
cryptoserve_client-0.2.0.tar.gz
(20.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cryptoserve_client-0.2.0.tar.gz.
File metadata
- Download URL: cryptoserve_client-0.2.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3be86c994987604bd02b7a769d2ad8b89bdd039aab31bbc14b8a8af275685e79
|
|
| MD5 |
908fc2829971f9177bfdd5946f86ee1f
|
|
| BLAKE2b-256 |
d270ad9d8846c0a236748f3c899f65624e9f1430666205fb235376cadbce72c4
|
File details
Details for the file cryptoserve_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cryptoserve_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06637f1c67bf5988ff0e8c68079bd94d65c91d56bfce02e0a25dac0aaf2638ba
|
|
| MD5 |
f8413afc85cd55484c588c86c5ef6461
|
|
| BLAKE2b-256 |
b72f08068ab780ca1f83fa8dd7a193f365ce0cb4620449ab77c6351764154112
|