Trait yubihsm::adapters::Adapter [−][src]
pub trait Adapter: Sized + Send + Sync { type Config: Debug + Default + Send + Sync; fn open(config: &Self::Config) -> Result<Self, AdapterError>; fn healthcheck(&self) -> Result<(), AdapterError>; fn send_message(
&self,
uuid: Uuid,
msg: Vec<u8>
) -> Result<Vec<u8>, AdapterError>; }
Adapters for communicating with the YubiHSM2
Associated Types
Required Methods
fn open(config: &Self::Config) -> Result<Self, AdapterError>
Open a connection to this adapter
fn healthcheck(&self) -> Result<(), AdapterError>
Are we able to send/receive messages to/from the HSM?
fn send_message(
&self,
uuid: Uuid,
msg: Vec<u8>
) -> Result<Vec<u8>, AdapterError>
&self,
uuid: Uuid,
msg: Vec<u8>
) -> Result<Vec<u8>, AdapterError>
Send a command message to the HSM, then read and return the response
Implementors
impl Adapter for HttpAdapter type Config = HttpConfig;
impl Adapter for UsbAdapter type Config = UsbConfig;
impl Adapter for MockAdapter type Config = MockHsm;