TERE API Reference
The TERE API lets you work with Trusted Execution Environments securely and easily through our SDK and CLI tools. This reference covers the key functionality you'll use to deploy, manage, and execute code in secure TEEs.
Getting Started
Quick Setup
The fastest way to get started with TERE is through our SDK and CLI:
SDK Installation
CLI Installation
Authentication
Authenticate with your API key:
Or using the CLI:
Complete Workflow Example
Here's a complete example of using TERE to deploy and execute a secure application:
The same workflow using the CLI:
API Components
The TERE API is divided into several key components, all accessible through the SDK and CLI:
- Runtime API
Deploy applications to TEEs and execute functions within them.
- Attestation API
Verify that code is running in a genuine TEE with the expected security properties.
- State Management API
Store and retrieve data securely within the TEE.
- Cryptography API
Encrypt, decrypt, and hash data securely within the TEE.
- Deployment API
Deploy and manage TERE applications across different TEE environments.
Common API Methods
These are the most commonly used SDK methods for working with TERE:
Method | Description |
---|---|
client.deploy() | Deploys a TERE script to a Trusted Execution Environment |
client.execute() | Executes a function in a deployed TERE script |
client.verifyAttestation() | Verifies an attestation to ensure it came from a genuine TEE |
client.listScripts() | Lists all deployed TERE scripts |
client.getScript() | Gets detailed information about a specific deployed script |
client.getJobStatus() | Retrieves the status of an asynchronous execution job |
TerePackager.createScript() | Creates a TERE script from code and metadata |
Error Handling
The TERE SDK provides structured error handling:
Common TERE error codes include:
Error Code | Description |
---|---|
auth_error | Authentication failed or token expired |
invalid_script | Invalid TERE script format |
script_not_found | The specified script ID was not found |
function_not_found | The specified function was not found in the script |
execution_error | An error occurred during function execution |
attestation_error | Attestation verification failed |
SDK vs CLI
SDK
Programmatic integration for applications and services. Use the SDK when you need to:
- Integrate TERE into your application
- Automate TERE operations
- Build custom workflows
- Implement complex logic around TEE operations
CLI
Command-line tool for development and operations. Use the CLI when you need to:
- Quickly test and debug TERE operations
- Use in CI/CD pipelines
- Run one-off operations
- Explore TERE features interactively