# CipherStash Client SDK
[](https://crates.io/crates/cipherstash-client)
[](https://docs.rs/cipherstash-client/)
[](https://cipherstash.com)
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`
```toml
[dependencies]
cipherstash-client = "0.28.0"
```
### Creating a ZeroKMS Client
Use the [`ZeroKMSConfig`] to create a new [`ZeroKMS`] client. With this you can:
- Manage datasets, config and clients
- Encrypt and decrypt data
```no_run
use cipherstash_client::{ZeroKMSConfig, config::EnvSource};
#[tokio::main]
async fn main() {
let client = ZeroKMSConfig::builder()
.add_source(EnvSource::new())
.build()
.expect("failed to build config")
.create_client();
let keyset = client.create_dataset("users", "A keyset used to encrypt my users' information")
.await
.expect("failed to create keyset");
}
```
### Creating a CTS Client
Use the [`CtsConfig`] struct to create a new [`CtsClient`]. With this you can:
- Manage access keys and identity tokens
```rust,no_run
use cipherstash_client::{CtsConfig, ConsoleConfig, CtsClient, WorkspaceId};
use cts_common::claims::Role;
#[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 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");
}
```