signstar_download_key_certificates/
error.rs1#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
7 #[error("No HSM backend support compiled in")]
9 NoBackend,
10
11 #[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
13 #[error("No connection set for the backend")]
14 NoConnection,
15
16 #[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
18 #[error("No credentials for the system user {user}")]
19 NoCredentials {
20 user: String,
22 },
23
24 #[error("Signstar config error: {0}")]
26 Config(#[from] signstar_config::Error),
27
28 #[error("No credentials for the system user {user}")]
30 InvalidUser {
31 user: String,
33 },
34
35 #[cfg(feature = "nethsm")]
37 #[error("NetHSM error: {0}")]
38 NetHsm(#[from] nethsm::Error),
39
40 #[error("JSON serialization error: {0}")]
42 Serialization(#[from] serde_json::Error),
43 #[error(transparent)]
46 SignstarCommon(#[from] signstar_common::Error),
47
48 #[error(transparent)]
50 SignstarCrypto(#[from] signstar_crypto::Error),
51
52 #[error("Unsupported key context for signing key: {signing_key_id}")]
54 UnsupportedKeyContext {
55 signing_key_id: String,
57 },
58
59 #[cfg(feature = "yubihsm2")]
61 #[error(transparent)]
62 YubiHsm(#[from] signstar_yubihsm2::Error),
63}