signstar_config/yubihsm2/
backend.rs

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