confium_pkcs11_server/
slot.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
7pub struct SlotId(pub u64);
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct SlotInfo {
12 pub description: String,
14 pub manufacturer: String,
16 pub token_present: bool,
18 pub hardware: bool,
20 pub quorum_id: String,
22}
23
24impl SlotInfo {
25 pub fn for_quorum(quorum_id: impl Into<String>) -> Self {
27 let qid = quorum_id.into();
28 Self {
29 description: format!("Confium quorum: {qid}"),
30 manufacturer: "Confium Project".into(),
31 token_present: true,
32 hardware: false,
33 quorum_id: qid,
34 }
35 }
36}