Crates.io | cipherstash-client |
lib.rs | cipherstash-client |
version | 0.13.0-pre.1 |
source | src |
created_at | 2022-05-12 00:53:14.805975 |
updated_at | 2024-10-31 10:41:05.722837 |
description | The official CipherStash SDK |
homepage | https://cipherstash.com |
repository | https://github.com/cipherstash/cipherstash |
max_upload_size | |
id | 584949 |
size | 600,928 |
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.
To get started add the cipherstash-client
dependency to your Cargo.toml
[dependencies]
cipherstash-client = "0.12"
Use the [ZeroKMSConfig
] to create a new [ZeroKMS
] client. With this you can:
use cipherstash_client::ZeroKMSConfig;
#[tokio::main]
async fn main() {
let client = ZeroKMSConfig::builder()
.with_env()
.build()
.expect("failed to build config")
.create_client();
let dataset = client.create_dataset("users", "A dataset used to encrypt my users' information")
.await
.expect("failed to create dataset");
}
Use the [CtsConfig
] struct to create a new [CTSClient
]. With this you can:
use cipherstash_client::{ CtsConfig, ConsoleConfig, CTSClient };
#[tokio::main]
async fn main() {
let console_config = ConsoleConfig::builder()
.with_env()
.build()
.expect("failed to build config");
let cts_config = CtsConfig::builder()
.with_env()
.build()
.expect("failed to build config");
let client = CTSClient::new(cts_config.base_url(), console_config.credentials());
let access_key = client.create_access_key("Test Access Key", "WORKSPACE-A")
.await
.expect("failed to create access key");
}