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
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Typed async and blocking client for the Crypto Service REST API.
//!
//! [crypto-server](https://github.com/sebastienrousseau/crypto-service)
//! exposes hashing, MACs, key derivation, AEAD, server-held signing and
//! decryption keys, ML-KEM, ML-DSA, SLH-DSA, HPKE, KMS and OPAQUE over
//! HTTP. This crate is a thin client for its v2 API: one method per
//! operation, and no cryptography of its own. Every operation is an HTTP
//! call to the server.
//!
//! ```no_run
//! use crypto_service_sdk::{Client, HashAlgorithm, HashRequest};
//!
//! # async fn run() -> Result<(), crypto_service_sdk::Error> {
//! let client = Client::builder("http://127.0.0.1:3000")
//! .api_key("synthetic-api-key-0000000000000000")
//! .build()?;
//! let digest = client
//! .hash(&HashRequest {
//! algorithm: HashAlgorithm::Sha256,
//! data: "abc".into(),
//! })
//! .await?;
//! println!("{}", digest.digest);
//! # Ok(())
//! # }
//! ```
//!
//! A non-2xx answer becomes [`Error::Api`] with the server's RFC 9457
//! [`Problem`]; no answer at all becomes [`Error::Transport`]. Retries are
//! off unless a [`RetryPolicy`] turns them on, and a call that creates or
//! deletes server state is never retried after the server may have acted
//! on it. Keys, passwords and plaintexts travel in [`SecretBytes`] and
//! [`SecretString`], which are zeroised on drop and redacted in `Debug`.
//!
//! With the `blocking` feature, `blocking::Client` offers the same methods
//! without `async`.
/// The decoding paths without the network, for `fuzz/` and `benches/`.
/// Not public API: it exists only under `cfg(fuzzing)`, with the
/// `internals` feature, and in unit tests.
pub use ;
pub use ;
pub use ;
pub use ;
pub use RetryPolicy;
pub use ;
pub use ;
pub use *;
/// `http`, re-exported for [`RawRequest`], [`HttpRequest`] and custom
/// [`Transport`]s.
pub use http;
/// Compiles the README's Rust snippets as doctests.
;