Skip to main content

signstar_host/download_key_certificates/
mod.rs

1//! Retrieval of key certificates from Signstar hosts.
2
3mod error;
4
5pub use error::Error;
6#[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
7use signstar_common::request_api::Certificate;
8
9#[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
10mod backend;
11#[cfg(feature = "cli")]
12#[doc(hidden)]
13pub mod cli;
14
15#[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
16pub use backend::load_certificates;
17
18/// Loads [`Certificate`]s from signing keys used in Signstar configuration.
19///
20/// # Errors
21///
22/// Always returns an error, because no HSM backend support is compiled in.
23#[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
24pub fn load_certificates() -> Result<Vec<Certificate>, Error> {
25    Err(Error::NoBackend)
26}