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
Metadata
Release files for cryptoserve-client 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cryptoserve_client-0.3.0.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cryptoserve_client-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.3 kB
Release files / cryptoserve_client-0.3.0.tar.gz
| Download URL | cryptoserve_client-0.3.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f8d03c95af6132f2abc7a787acf5ddd1782b1b82bcc8fe687c706f77f967705
|
|
BLAKE2b-256 checksum How to use checksums |
ea9643d18ba5aa7a5d4a07b1edcf7de151eefea4338ceb76b48bd44e23c56d37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cryptoserve_client-0.3.0-py3-none-any.whl
| Download URL | cryptoserve_client-0.3.0-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b63f5c375870781913b79fa5a82f742c1e87fcb3b88480f203a060ee9715f93
|
|
BLAKE2b-256 checksum How to use checksums |
119bb0bcf539b2a1ea2e7b32c9a22f2bfe17a87dfdd7675be6c59b2d1adf8a65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|