pub struct Card<T, Ctx>where
T: HandlerInCtx<Ctx>,
Ctx: Copy,{ /* private fields */ }Expand description
An adapter to communicate with the card through the delegate
Implementations§
Source§impl<T, Ctx> Card<T, Ctx>where
T: HandlerInCtx<Ctx>,
Ctx: Copy,
impl<T, Ctx> Card<T, Ctx>where
T: HandlerInCtx<Ctx>,
Ctx: Copy,
Sourcepub fn select_df(&self, ctx: Ctx, name: Vec<u8>) -> Result<(), Error>
pub fn select_df(&self, ctx: Ctx, name: Vec<u8>) -> Result<(), Error>
Selects a DF with their name.
Sourcepub fn select_ef(&self, ctx: Ctx, id: Vec<u8>) -> Result<(), Error>
pub fn select_ef(&self, ctx: Ctx, id: Vec<u8>) -> Result<(), Error>
Selects a EF with their name.
Sourcepub fn read(&self, ctx: Ctx, len: Option<u16>) -> Result<Vec<u8>, Error>where
Ctx: Copy,
pub fn read(&self, ctx: Ctx, len: Option<u16>) -> Result<Vec<u8>, Error>where
Ctx: Copy,
Reads binary from the selected file for len octets max.
Sourcepub fn sign(&self, ctx: Ctx, digest: Vec<u8>) -> Result<Vec<u8>, Error>
pub fn sign(&self, ctx: Ctx, digest: Vec<u8>) -> Result<Vec<u8>, Error>
Computes a signature using the selected key.
Sourcepub fn verify_pin(
&self,
ctx: Ctx,
ef: [u8; 2],
pin: Vec<u8>,
) -> Result<(), Error>
pub fn verify_pin( &self, ctx: Ctx, ef: [u8; 2], pin: Vec<u8>, ) -> Result<(), Error>
Selects a EF then verifies the pin using the EF.
pub fn pin_status(&self, ctx: Ctx, ef: [u8; 2]) -> Result<u8, Error>
Sourcepub fn read_der_size(&self, ctx: Ctx) -> Result<u16, Error>
pub fn read_der_size(&self, ctx: Ctx) -> Result<u16, Error>
Extracts the size of current file by reading DER-encoded ASN.1 header.
Auto Trait Implementations§
impl<T, Ctx> Freeze for Card<T, Ctx>
impl<T, Ctx> RefUnwindSafe for Card<T, Ctx>where
Ctx: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Ctx> Send for Card<T, Ctx>
impl<T, Ctx> Sync for Card<T, Ctx>
impl<T, Ctx> Unpin for Card<T, Ctx>where
Ctx: Unpin,
impl<T, Ctx> UnwindSafe for Card<T, Ctx>where
Ctx: UnwindSafe,
T: UnwindSafe,
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