2021-04-27 00:37:58 +02:00
|
|
|
use crate::iso7816_4::apducommand::APDUCommand;
|
2021-12-26 02:33:05 +01:00
|
|
|
use crate::iso7816_4::apduresponse::APDUResponse;
|
2021-04-27 00:37:58 +02:00
|
|
|
use error::Result;
|
|
|
|
|
2021-01-24 05:19:35 +01:00
|
|
|
pub mod crypto;
|
|
|
|
pub mod desfire;
|
2021-04-27 00:37:58 +02:00
|
|
|
pub mod error;
|
2021-12-26 02:33:05 +01:00
|
|
|
pub mod iso7816_4;
|
2021-04-27 00:37:58 +02:00
|
|
|
|
2021-12-24 20:44:27 +01:00
|
|
|
pub trait Card {
|
2021-12-26 02:33:05 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Connect to Smartcard
|
|
|
|
/// </summary>
|
|
|
|
fn connect(&mut self) -> Result<()>;
|
2021-04-27 00:37:58 +02:00
|
|
|
|
2021-12-26 02:33:05 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Disconnect from Smartcard
|
|
|
|
/// </summary>
|
|
|
|
fn disconnect(&mut self) -> Result<()>;
|
2021-04-27 00:37:58 +02:00
|
|
|
|
2021-12-26 02:33:05 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Transmit APDU Command to Smartcard
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="apdu_cmd">Application Protocol Data Unit Command - ISO 7816</param>
|
|
|
|
/// <returns>Application Protocol Data Unit Response - ISO 7816</returns>
|
|
|
|
fn transmit(&self, apdu_cmd: APDUCommand) -> Result<APDUResponse>;
|
2021-04-27 00:37:58 +02:00
|
|
|
}
|