Ecc

Struct Ecc 

Source
pub struct Ecc { /* private fields */ }

Implementations§

Source§

impl Ecc

Source

pub fn from_path( path: &str, address: u16, config: Option<EccConfig>, ) -> Result<Self>

Source

pub fn get_info(&mut self) -> Result<Bytes>

Source

pub fn get_serial(&mut self) -> Result<Bytes>

Returns the 9 bytes that represent the serial number of the ECC. Per section 2.2.6 of the Data Sheet the first two, and last byte of the returned binary will always be [0x01, 0x23] and 0xEE

Source

pub fn genkey(&mut self, key_type: KeyType, slot: u8) -> Result<Bytes>

Source

pub fn get_slot_config(&mut self, slot: u8) -> Result<SlotConfig>

Source

pub fn set_slot_config(&mut self, slot: u8, config: &SlotConfig) -> Result

Source

pub fn get_key_config(&mut self, slot: u8) -> Result<KeyConfig>

Source

pub fn set_key_config(&mut self, slot: u8, config: &KeyConfig) -> Result

Source

pub fn get_locked(&mut self, zone: &Zone) -> Result<bool>

Source

pub fn set_locked(&mut self, zone: Zone) -> Result

Source

pub fn sign(&mut self, key_slot: u8, data: &[u8]) -> Result<Bytes>

Source

pub fn ecdh(&mut self, key_slot: u8, x: &[u8], y: &[u8]) -> Result<Bytes>

Source

pub fn random(&mut self) -> Result<Bytes>

Source

pub fn nonce(&mut self, target: DataBuffer, data: &[u8]) -> Result

Source

pub fn read(&mut self, read_32: bool, address: Address) -> Result<Bytes>

Source

pub fn write(&mut self, address: Address, bytes: &[u8]) -> Result

Auto Trait Implementations§

§

impl Freeze for Ecc

§

impl !RefUnwindSafe for Ecc

§

impl Send for Ecc

§

impl !Sync for Ecc

§

impl Unpin for Ecc

§

impl !UnwindSafe for Ecc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.