signstar_config/yubihsm2/
backend.rs

1//! Backend handling for YubiHSM2.
2
3use serde::{Deserialize, Serialize};
4use signstar_yubihsm2::yubihsm::SerialNumber;
5
6/// A connection to the YubiHSM2 backend.
7#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
8#[serde(rename_all = "lowercase")]
9pub enum YubiHsmConnection {
10    /// Connection to a Mock HSM.
11    ///
12    /// # Note
13    ///
14    /// MockHSMs are only used for testing.
15    Mock,
16
17    /// Connection to a device over USB.
18    ///
19    /// Each YubiHSM2 is identified by a unique serial number.
20    Usb {
21        /// Serial number of the connected YubiHSM2.
22        serial_number: SerialNumber,
23    },
24}