9 unstable releases (3 breaking)

new 0.14.0 Dec 11, 2024
0.13.0-pre.1 Oct 31, 2024
0.6.0 Dec 8, 2022
0.5.0 Nov 15, 2022
0.2.2 Jul 25, 2022

#296 in Cryptography

Download history 2/week @ 2024-09-17 365/week @ 2024-09-24 110/week @ 2024-10-01 704/week @ 2024-10-08 420/week @ 2024-10-15 266/week @ 2024-10-22 491/week @ 2024-10-29 123/week @ 2024-11-05 178/week @ 2024-11-12 134/week @ 2024-11-19 179/week @ 2024-11-26 277/week @ 2024-12-03

781 downloads per month
Used in 2 crates

Custom license

630KB
15K SLoC

CipherStash Client SDK

Crates.io Version docs.rs Built by CipherStash

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.12"

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
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");
}

Creating a CTS Client

Use the CtsConfig struct to create a new CTSClient. With this you can:

  • Manage access keys and identity tokens
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");
}

Dependencies

~27–45MB
~757K SLoC