pub struct HsmConfig {
pub provider: HsmProvider,
pub library_path: String,
pub pin: String,
pub slot_id: Option<u64>,
pub token_label: Option<String>,
pub pkcs11_uri: Option<String>,
pub max_sessions: usize,
}Expand description
[hsm] section — PKCS#11 HSM configuration.
[hsm]
provider = "entrust"
library_path = "/opt/nfast/toolkits/pkcs11/libcknfast.so"
pin = "env:KIPUKA_HSM_PIN"
slot_id = 0Fields§
§provider: HsmProviderHSM middleware provider.
library_path: StringAbsolute path to the PKCS#11 shared library (.so / .dylib / .dll).
pin: StringPKCS#11 user PIN for session login.
Supports "env:VAR_NAME" syntax to read the PIN from an
environment variable at startup, avoiding plaintext storage
in the config file.
slot_id: Option<u64>PKCS#11 slot ID to use.
When absent, the first available slot is used.
token_label: Option<String>PKCS#11 token label (alternative to slot_id).
When both slot_id and token_label are set, slot_id takes
precedence.
pkcs11_uri: Option<String>PKCS#11 URI for advanced key identification.
Example: "pkcs11:token=kipuka;object=ca-key;type=private"
This is a template for CA keys; per-CA pkcs11_uri in [[ca]]
overrides this when present.
max_sessions: usizeMaximum concurrent PKCS#11 sessions.
Limits the number of simultaneous signing operations to avoid exhausting HSM session resources. Default: 8.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HsmConfig
impl<'de> Deserialize<'de> for HsmConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for HsmConfig
impl RefUnwindSafe for HsmConfig
impl Send for HsmConfig
impl Sync for HsmConfig
impl Unpin for HsmConfig
impl UnsafeUnpin for HsmConfig
impl UnwindSafe for HsmConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more