pub struct HostConfiguration<'config> {
config: &'config Config,
}Expand description
Signstar host configuration.
Manages the synchronization of HSM backends with the Signstar configuration, as well as the configuration of non-administrative users and their credentials for their respective backends.
Fields§
§config: &'config ConfigThe Signstar configuration.
Implementations§
Source§impl<'config> HostConfiguration<'config>
impl<'config> HostConfiguration<'config>
Source§impl<'config> HostConfiguration<'config>
impl<'config> HostConfiguration<'config>
Source§impl<'config> HostConfiguration<'config>
impl<'config> HostConfiguration<'config>
Sourcefn load_nethsm_admin_credentials(&self) -> Result<NetHsmAdminCredentials, Error>
fn load_nethsm_admin_credentials(&self) -> Result<NetHsmAdminCredentials, Error>
Sourcefn available_nethsm_connections(config: &NetHsmConfig) -> Vec<NetHsm>
fn available_nethsm_connections(config: &NetHsmConfig) -> Vec<NetHsm>
Returns the list of available connections to NetHSM backends.
Sourcefn provisioned_nethsm_connections(config: &NetHsmConfig) -> Vec<&Connection>
fn provisioned_nethsm_connections(config: &NetHsmConfig) -> Vec<&Connection>
Returns the list of provisioned NetHSM backend connections.
Sourcefn create_nethsm_non_admin_credentials(
&self,
) -> Result<Vec<FullCredentials>, Error>
fn create_nethsm_non_admin_credentials( &self, ) -> Result<Vec<FullCredentials>, Error>
Creates new credentials for all non-administrative NetHSM backend users.
§Errors
Returns an error, if the non-administrative credentials for a specific user cannot be created.
Sourcefn sync_nethsm_backends(
&self,
available_connections: Vec<NetHsm>,
admin_credentials: &NetHsmAdminCredentials,
user_credentials: &[FullCredentials],
) -> Result<(), Error>
fn sync_nethsm_backends( &self, available_connections: Vec<NetHsm>, admin_credentials: &NetHsmAdminCredentials, user_credentials: &[FullCredentials], ) -> Result<(), Error>
Syncs all available NetHSM backends.
Returns early success, if there is no NetHSM section in the Signstar config.
§Errors
Returns an error, if
NetHsmAdminCredentials::loadcannot load administrative credentials- a
NetHsmBackendcannot be created for a connection - running
NetHsmBackend::syncfor a specific backend fails
Sourcepub fn sync_nethsm(&self) -> Result<ConfigurationResult, Error>
pub fn sync_nethsm(&self) -> Result<ConfigurationResult, Error>
Syncs the states of all available NetHSM backends with that of the Signstar configuration.
§Errors
Returns an error, if
- the creation of non-administrative credentials fails
- the syncing of the backend fails
Source§impl<'config> HostConfiguration<'config>
impl<'config> HostConfiguration<'config>
Sourcefn load_yubihsm2_admin_credentials(
&self,
) -> Result<YubiHsm2AdminCredentials, Error>
fn load_yubihsm2_admin_credentials( &self, ) -> Result<YubiHsm2AdminCredentials, Error>
Sourcefn create_yubihsm2_non_admin_credentials(
&self,
) -> Result<Vec<Credentials>, Error>
fn create_yubihsm2_non_admin_credentials( &self, ) -> Result<Vec<Credentials>, Error>
Creates new credentials for all non-administrative YubiHSM2 backend users.
§Errors
Returns an error, if the non-administrative credentials for a specific user cannot be created.
Sourcefn available_yubihsm2_connections(config: &YubiHsm2Config) -> Vec<Connector>
fn available_yubihsm2_connections(config: &YubiHsm2Config) -> Vec<Connector>
Returns the list of available connections to YubiHSM2 backends.
Sourcefn provisioned_yubihsm2_connections(config: &YubiHsm2Config) -> Vec<&Connection>
fn provisioned_yubihsm2_connections(config: &YubiHsm2Config) -> Vec<&Connection>
Returns the list of provisioned YubiHSM2 backend connections.
Sourcefn sync_yubihsm2_backends(
&self,
available_connections: Vec<Connector>,
admin_credentials: &YubiHsm2AdminCredentials,
user_credentials: &[Credentials],
) -> Result<(), Error>
fn sync_yubihsm2_backends( &self, available_connections: Vec<Connector>, admin_credentials: &YubiHsm2AdminCredentials, user_credentials: &[Credentials], ) -> Result<(), Error>
Syncs all available YubiHSM2 backends.
Returns early success, if there is no YubiHSM2 section in the Signstar config.
§Errors
Returns an error, if
YubiHsm2AdminCredentials::loadcannot load administrative credentials- a
YubiHsm2Backendcannot be created for a connection - running
YubiHsm2Backend::syncfor a specific backend fails
Sourcepub fn sync_yubihsm2(&self) -> Result<ConfigurationResult, Error>
pub fn sync_yubihsm2(&self) -> Result<ConfigurationResult, Error>
Syncs the states of all available YubiHSM2 backends with that of the Signstar configuration.
§Errors
Returns an error, if
- the creation of non-administrative credentials fails
- the syncing of the backend fails
Trait Implementations§
Auto Trait Implementations§
impl<'config> Freeze for HostConfiguration<'config>
impl<'config> RefUnwindSafe for HostConfiguration<'config>
impl<'config> Send for HostConfiguration<'config>
impl<'config> Sync for HostConfiguration<'config>
impl<'config> Unpin for HostConfiguration<'config>
impl<'config> UnsafeUnpin for HostConfiguration<'config>
impl<'config> UnwindSafe for HostConfiguration<'config>
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.