43 releases (22 breaking)
| new 0.34.1-alpha.2 | Apr 9, 2026 |
|---|---|
| 0.34.0-alpha.5 | Mar 26, 2026 |
| 0.31.0 | Dec 3, 2025 |
| 0.30.0 | Nov 21, 2025 |
| 0.2.2 |
|
#431 in Cryptography
83 downloads per month
Used in 2 crates
1MB
28K
SLoC
CipherStash Client SDK
Website | Docs | Discussions
The CipherStash SDK is the main way of interacting with CipherStash services. It includes clients for talking to ZeroKMS, CipherStash Token Service (CTS) and the services used to power Audit.
It also contains all the indexing and encryption logic used in CipherStash products.
Getting Started
To get started add the cipherstash-client dependency to your Cargo.toml
[dependencies]
cipherstash-client = "0.34.0"
Creating a ZeroKMS Client
Use ZeroKMSBuilder to create a new ZeroKMS client. With this you can:
- Manage keysets, config and clients
- Encrypt and decrypt data
use cipherstash_client::zerokms::ZeroKMSBuilder;
#[tokio::main]
async fn main() {
let client = ZeroKMSBuilder::auto()
.expect("failed to detect credentials")
.build()
.expect("failed to build client");
let keyset = client.create_keyset("users", "A keyset used to encrypt my users' information")
.await
.expect("failed to create keyset");
}
Creating a CTS Client
Use CtsClient to manage access keys and identity tokens:
use cipherstash_client::{CtsClient, Region, WorkspaceId};
use cts_common::claims::Role;
use stack_auth::{AccessKey, AccessKeyStrategy};
#[tokio::main]
async fn main() {
let region = Region::aws("ap-southeast-2").unwrap();
let key: AccessKey = "CSAKmyKeyId.myKeySecret".parse().unwrap();
let strategy = AccessKeyStrategy::new(region, key).unwrap();
let client = CtsClient::new(strategy);
let workspace_id = WorkspaceId::try_from("E4UMRN47WJNSMAKR").expect("Valid ID");
let access_key = client.create_access_key("Test Access Key", workspace_id, Role::Admin)
.await
.expect("failed to create access key");
}
Dependencies
~127MB
~3M SLoC