libs.nfc_rs/src/lib.rs

37 lines
1005 B
Rust
Raw Normal View History

//! # desfire
//!
//! **WARNING** This is alpha quality software at best and should not be relied upon. **WARNING**
//!
//!The `desfire` Crate provides the cryptographic methods and specific commands for interfacing
//! with NXP MiFare Desfire cards.
//!
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
}
2022-01-06 17:14:17 +01:00