Trait yubihsm::connector::Connector [−][src]
pub trait Connector: Sized + Send + Sync { type Config: Debug + Default + Display; fn open(config: Self::Config) -> Result<Self, ConnectorError>; fn reconnect(&self) -> Result<(), ConnectorError>; fn status(&self) -> Result<Status, ConnectorError>; fn send_command(
&self,
uuid: Uuid,
cmd: Vec<u8>
) -> Result<Vec<u8>, ConnectorError>; }
API for communicating with a yubihsm-connector
Associated Types
Required Methods
fn open(config: Self::Config) -> Result<Self, ConnectorError>
Open a connection to a yubihsm-connector
fn reconnect(&self) -> Result<(), ConnectorError>
Reconnect to yubihsm-connector, closing the existing connection
fn status(&self) -> Result<Status, ConnectorError>
GET /connector/status returning the result as connector::Status
fn send_command(
&self,
uuid: Uuid,
cmd: Vec<u8>
) -> Result<Vec<u8>, ConnectorError>
&self,
uuid: Uuid,
cmd: Vec<u8>
) -> Result<Vec<u8>, ConnectorError>
POST /connector/api with a given command message and return the response message
Implementors
impl Connector for HttpConnector type Config = HttpConfig;
impl Connector for MockConnector type Config = MockConfig;