Struct yubirs::piv::hal::PcscHardware
source · pub struct PcscHardware { /* private fields */ }
Expand description
An implementation of PcscHal which actually talks to real hardware using the PC/SC library.
Implementations§
source§impl PcscHardware
impl PcscHardware
pub fn new_with_recording<P: AsRef<Path>>(output: P) -> Result<Self>
Trait Implementations§
source§impl Drop for PcscHardware
impl Drop for PcscHardware
source§impl PcscHal for PcscHardware
impl PcscHal for PcscHardware
source§fn new() -> Result<Self>
fn new() -> Result<Self>
Construct a new HAL, ready to connect to / interact with underlying
hardware.
source§fn secure_random_bytes(&self, buf: &mut [u8]) -> Result<()>
fn secure_random_bytes(&self, buf: &mut [u8]) -> Result<()>
Populate the given buffer with cryptographically secure random bytes.
source§fn cheap_random_bytes(&self, buf: &mut [u8]) -> Result<()>
fn cheap_random_bytes(&self, buf: &mut [u8]) -> Result<()>
Populate the given buffer with cheap-to-generate but possibly weak
random bytes. NOTE: be extremely careful with using this function in
cryptographically sensitive situations.
source§fn list_readers(&self) -> Result<Vec<String>>
fn list_readers(&self) -> Result<Vec<String>>
Return a list of the PC/SC readers currently available on the system.
source§fn connect_impl(&mut self, reader: &str) -> Result<()>
fn connect_impl(&mut self, reader: &str) -> Result<()>
Actually connect to the given reader using the native PC/SC library.
This trait already provides the higher level
connect
, which handles
selecting the right reader, and performing setup interactions with the
device after connecting. This function simply wraps the real interaction
with the underlying hardware.source§fn disconnect(&mut self)
fn disconnect(&mut self)
Disconnect from the current reader, if any.
source§fn send_data_impl(&self, apdu: &Apdu) -> Result<(StatusWord, Vec<u8>)>
fn send_data_impl(&self, apdu: &Apdu) -> Result<(StatusWord, Vec<u8>)>
Send data to the underlying hardware. The given byte slice must be formatted as a smart
card APDU (https://en.wikipedia.org/wiki/Smart_card_application_protocol_data_unit). This
function should return a status word, as well as any bytes returned by the hardware.
source§fn begin_transaction(&self) -> Result<()>
fn begin_transaction(&self) -> Result<()>
Start a new PC/SC transaction with the underlying hardware.
source§fn end_transaction(&self) -> Result<()>
fn end_transaction(&self) -> Result<()>
End a previously started PC/SC transaction with the underlying hardware.
Auto Trait Implementations§
impl RefUnwindSafe for PcscHardware
impl !Send for PcscHardware
impl !Sync for PcscHardware
impl Unpin for PcscHardware
impl UnwindSafe for PcscHardware
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
Mutably borrows from an owned value. Read more