Skip to main content

AppCheckerSha256

Struct AppCheckerSha256 

Source
pub struct AppCheckerSha256 { /* private fields */ }
Expand description

A Credentials Checking Policy that only runs Userspace Binaries which have a unique SHA256 credential.

A Userspace Binary without a SHA256 credential fails checking, and only one Userspace Binary with a particular SHA256 hash runs at any time.

Implementations§

Source§

impl AppCheckerSha256

Source

pub fn new( hash: &'static dyn Sha256Verifier<'static>, buffer: &'static mut [u8; 32], ) -> AppCheckerSha256

Trait Implementations§

Source§

impl AppCredentialsPolicy<'static> for AppCheckerSha256

Source§

fn require_credentials(&self) -> bool

Whether credentials are required or not. Read more
Source§

fn check_credentials( &self, credentials: TbfFooterV2Credentials, binary: &'static [u8], ) -> Result<(), (ErrorCode, TbfFooterV2Credentials, &'static [u8])>

Check a particular credential. Read more
Source§

fn set_client(&self, client: &'static dyn AppCredentialsPolicyClient<'static>)

Set the client which gets notified after the credential check completes.
Source§

impl ClientData<32> for AppCheckerSha256

Source§

fn add_mut_data_done( &self, _result: Result<(), ErrorCode>, _data: SubSliceMut<'static, u8>, )

Called when the data has been added to the digest. Read more
Source§

fn add_data_done( &self, result: Result<(), ErrorCode>, data: SubSlice<'static, u8>, )

Called when the data has been added to the digest. Read more
Source§

impl ClientHash<32> for AppCheckerSha256

Source§

fn hash_done( &self, _result: Result<(), ErrorCode>, _digest: &'static mut [u8; 32], )

Called when a digest is computed. Read more
Source§

impl ClientVerify<32> for AppCheckerSha256

Source§

fn verification_done( &self, result: Result<bool, ErrorCode>, compare: &'static mut [u8; 32], )

Called when a verification is computed. Read more

Auto Trait Implementations§

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, const DIGEST_LEN: usize> Client<DIGEST_LEN> for T
where T: ClientData<DIGEST_LEN> + ClientHash<DIGEST_LEN> + ClientVerify<DIGEST_LEN>,

Source§

impl<T, const DIGEST_LEN: usize> ClientDataHash<DIGEST_LEN> for T
where T: ClientData<DIGEST_LEN> + ClientHash<DIGEST_LEN>,

Source§

impl<T, const DIGEST_LEN: usize> ClientDataVerify<DIGEST_LEN> for T
where T: ClientData<DIGEST_LEN> + ClientVerify<DIGEST_LEN>,

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, 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.