Struct yubihsm::session::Session
[−]
[src]
pub struct Session<C = DefaultConnector> where
C: Connector, { /* fields omitted */ }
Encrypted session with the YubiHSM2
Generic over connector types in case a different one needs to be swapped in
Methods
impl Session<DefaultConnector>
[src]
Methods which are only available on the default connector
pub fn create(
connector_url: &str,
auth_key_id: ObjectId,
static_keys: StaticKeys,
reconnect: bool
) -> Result<Self, Error>
[src]
connector_url: &str,
auth_key_id: ObjectId,
static_keys: StaticKeys,
reconnect: bool
) -> Result<Self, Error>
Open a new session to the HSM, authenticating with the given keypair
pub fn create_from_password(
connector_url: &str,
auth_key_id: ObjectId,
password: &str,
reconnect: bool
) -> Result<Self, Error>
[src]
connector_url: &str,
auth_key_id: ObjectId,
password: &str,
reconnect: bool
) -> Result<Self, Error>
Open a new session to the HSM, authenticating with a given password
impl<C: Connector> Session<C>
[src]
pub fn new(
connector: C,
auth_key_id: ObjectId,
static_keys: StaticKeys,
reconnect: bool
) -> Result<Self, Error>
[src]
connector: C,
auth_key_id: ObjectId,
static_keys: StaticKeys,
reconnect: bool
) -> Result<Self, Error>
Create a new encrypted session using the given connector, YubiHSM2 auth key ID, and static identity keys
pub fn connector_status(&mut self) -> Result<ConnectorStatus, Error>
[src]
Request current yubihsm-connector status
pub fn blink(&mut self, num_seconds: u8) -> Result<BlinkResponse, Error>
[src]
Blink the YubiHSM2's LEDs (to identify it) for the given number of seconds
pub fn delete_object(
&mut self,
object_id: ObjectId,
object_type: ObjectType
) -> Result<DeleteObjectResponse, Error>
[src]
&mut self,
object_id: ObjectId,
object_type: ObjectType
) -> Result<DeleteObjectResponse, Error>
Delete an object of the given ID and type
pub fn echo<T>(&mut self, message: T) -> Result<EchoResponse, Error> where
T: Into<Vec<u8>>,
[src]
T: Into<Vec<u8>>,
Have the card echo an input message
pub fn generate_asymmetric_key(
&mut self,
key_id: ObjectId,
label: ObjectLabel,
domains: Domains,
capabilities: Capabilities,
algorithm: Algorithm
) -> Result<GenAsymmetricKeyResponse, Error>
[src]
&mut self,
key_id: ObjectId,
label: ObjectLabel,
domains: Domains,
capabilities: Capabilities,
algorithm: Algorithm
) -> Result<GenAsymmetricKeyResponse, Error>
Generate a new asymmetric key within the YubiHSM2
pub fn get_object_info(
&mut self,
object_id: ObjectId,
object_type: ObjectType
) -> Result<GetObjectInfoResponse, Error>
[src]
&mut self,
object_id: ObjectId,
object_type: ObjectType
) -> Result<GetObjectInfoResponse, Error>
Get information about an object
pub fn get_pubkey(
&mut self,
key_id: ObjectId
) -> Result<GetPubKeyResponse, Error>
[src]
&mut self,
key_id: ObjectId
) -> Result<GetPubKeyResponse, Error>
Get the public key for an asymmetric key stored on the device
See GetPubKeyResponse
for more information about public key formats
pub fn id(&self) -> SessionId
[src]
Get the current session ID
pub fn list_objects(&mut self) -> Result<ListObjectsResponse, Error>
[src]
List objects visible from the current session
pub fn sign_data_eddsa<T>(
&mut self,
key_id: ObjectId,
data: T
) -> Result<SignDataEdDSAResponse, Error> where
T: Into<Vec<u8>>,
[src]
&mut self,
key_id: ObjectId,
data: T
) -> Result<SignDataEdDSAResponse, Error> where
T: Into<Vec<u8>>,
Compute an Ed25519 signature with the given key ID