Skip to main content

signstar_host/sign/
error.rs

1//! Error handling for signing operations on a Signstar host.
2
3/// An error that may occur when signing with a Signstar host.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
7    /// No HSM backend support is compiled in.
8    #[error("No HSM backend support compiled in")]
9    NoBackend,
10
11    /// The configuration offers no connection for a backend.
12    #[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
13    #[error("No connection set for the backend")]
14    NoConnection,
15
16    /// No credentials found for current system user.
17    #[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
18    #[error("No credentials for the system user")]
19    NoCredentials,
20
21    /// Parameters of the signing request are unsupported.
22    #[error("Unsupported signing request parameters")]
23    UnsupportedParameters,
24
25    /// Parameters of the signing setup are unsupported.
26    #[error("Unsupported signer setup")]
27    #[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
28    UnsupportedSignerSetup,
29}