Related Links
Pre-requisites
1
Request repository access to the Packages
Reach out to Platform team to request access to the Packages repository:
2
Requirements
Installation
Usage
See the example below or checkexample.py for detailed usage:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Request repository access to the Packages
Requirements
pip install git+https://github.com/LocAI1/platform-encryption-python-sdk.git
brew install gh
gh auth login
pip install git+https://github.com/LocAI1/platform-encryption-python-sdk.git
example.py for detailed usage:
import asyncio
from encrova_sdk.EncrovaSDKClient import EncrovaSDKClient
async def main():
"""
Demonstrates the usage of Encrova SDK for encryption and decryption
operations.
The example shows:
1. Initializing the Encrova SDK client with symmetric or asymmetric encryption
2. Encrypting a JSON payload containing identity provider configurations
3. Decrypting the encrypted JWE (JSON Web Encryption) token
"""
# Initialize Encrova SDK client with symmetric or asymmetric encryption mode
# encryption_type can be either "symmetric" or "asymmetric"
encrova_client = EncrovaSDKClient(
host="http://localhost:8000",
encryption_type="symmetric"
)
# Encrypt a JSON payload using the encrypt API
# Parameters:
# - payload: JSON object containing the data to be encrypted
# - api_key: API key for authentication
# - secret_key: Secret key used for encryption
jwe = await encrova_client.service.encrypt(
payload={"username" : "udayakumar.rajan", "password" : "random"},
api_key="<API Key>",
secret_key="<Secret Key>"
)
print(f"jwe : {jwe}")
# Decrypt the JWE token using the decrypt API
# Parameters:
# - jwe: The encrypted JWE token to be decrypted
# - api_key: API key for authentication
plaintext = await encrova_client.service.decrypt(
jwe=jwe,
api_key="<API Key>"
)
print(f"plain text : {plaintext}")
""" Run the async main function """
if __name__ == "__main__":
asyncio.run(main())
