1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! ## CipherStash SDK
//!
//! 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
//!
//! ### 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;
//!
//! #[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
//!
//! ```no_run
//! 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");
//! }
//! ```
// Re-export
pub use cipherstash_config as schema;
pub use ;
pub use CTSClient;
pub use ZeroKMS;