Expand description
Interface to the vsmartcard daemon.
This crate makes it possible to connect to a vpcd
daemon and add a virtual smartcard by
implementing the VSmartCard
trait.
Examples
Running a dummy smartcard
fn main() -> std::io::Result<()> {
vpicc::connect()?.run(&mut vpicc::DummySmartCard)
}
Running a custom smartcard
struct Card;
impl vpicc::VSmartCard for Card {
fn execute(&mut self, data: &[u8]) -> Vec<u8> {
log::info!("Received APDU: {:x?}", data);
vec![0x90, 0x00] // 9000 == Success
}
}
fn main() -> std::io::Result<()> {
vpicc::connect()?.run(&mut Card)
}
Structs
A connection to the vpcd daemon.
A dummy VSmartCard
implementation that prints to the log instead of performing any
action.
Constants
The default ATR used in DummySmartCard
.
The default host used in connect
.
The default port used in connect
.
Traits
A virtual smartcard implementation.
Functions
Connects to the vpcd dameon using DEFAULT_HOST
and DEFAULT_PORT
.
Connects to the vpcd daemon at the given address.