Skip to main content

signstar_download_key_certificates/
lib.rs

1//! Library for the retrieval of key certificates.
2
3#[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
4use signstar_common::request_api::Certificate;
5
6#[cfg(not(any(feature = "nethsm", feature = "yubihsm2")))]
7use crate::error::Error;
8
9#[cfg(any(feature = "nethsm", feature = "yubihsm2"))]
10mod backend;
11#[cfg(feature = "cli")]
12pub mod cli;
13pub mod error;
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}