pub struct AppCheckerSignature<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> { /* private fields */ }
Expand description

Checker that validates a correct signature credential.

This checker provides the scaffolding on top of a hasher (&H) and a verifier (&S) for a given TbfFooterV2CredentialsType.

This assumes the TbfFooterV2CredentialsType data format only contains the signature (i.e. the data length of the credential in the TBF footer is the same as SL).

Implementations§

source§

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> AppCheckerSignature<'a, S, H, HL, SL>

source

pub fn new( hasher: &'a H, verifier: &'a S, hash_buffer: &'static mut [u8; HL], signature_buffer: &'static mut [u8; SL], credential_type: TbfFooterV2CredentialsType ) -> AppCheckerSignature<'a, S, H, HL, SL>

Trait Implementations§

source§

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> AppCredentialsPolicy<'static> for AppCheckerSignature<'a, S, H, HL, SL>

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<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> ClientData<HL> for AppCheckerSignature<'a, S, H, HL, SL>

source§

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

Called when the data has been added to the digest. data is the SubSliceMut passed in the call to add_mut_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are: 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. data is the SubSlice passed in the call to add_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are: Read more
source§

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> ClientHash<HL> for AppCheckerSignature<'a, S, H, HL, SL>

source§

fn hash_done( &self, result: Result<(), ErrorCode>, digest: &'static mut [u8; HL] )

Called when a digest is computed. digest is the same reference passed to run() to store the hash value. If result is Ok, digest stores the computed hash. If result is Err, the data stored in digest is undefined and may have any value. Valid ErrorCode values are: Read more
source§

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> ClientVerify<HL> for AppCheckerSignature<'a, S, H, HL, SL>

source§

fn verification_done( &self, _result: Result<bool, ErrorCode>, _compare: &'static mut [u8; HL] )

Called when a verification is computed. compare is the reference supplied to verify() and the data stored in compare is unchanged. On Ok the bool indicates if the computed hash matches the value in compare. Valid ErrorCode values are: Read more
source§

impl<'a, S: SignatureVerify<'static, HL, SL>, H: DigestDataHash<'a, HL>, const HL: usize, const SL: usize> ClientVerify<HL, SL> for AppCheckerSignature<'a, S, H, HL, SL>

source§

fn verification_done( &self, result: Result<bool, ErrorCode>, hash: &'static mut [u8; HL], signature: &'static mut [u8; SL] )

Called when the verification is complete. Read more

Auto Trait Implementations§

§

impl<'a, S, H, const HL: usize, const SL: usize> !Freeze for AppCheckerSignature<'a, S, H, HL, SL>

§

impl<'a, S, H, const HL: usize, const SL: usize> !RefUnwindSafe for AppCheckerSignature<'a, S, H, HL, SL>

§

impl<'a, S, H, const HL: usize, const SL: usize> !Send for AppCheckerSignature<'a, S, H, HL, SL>

§

impl<'a, S, H, const HL: usize, const SL: usize> !Sync for AppCheckerSignature<'a, S, H, HL, SL>

§

impl<'a, S, H, const HL: usize, const SL: usize> Unpin for AppCheckerSignature<'a, S, H, HL, SL>

§

impl<'a, S, H, const HL: usize, const SL: usize> !UnwindSafe for AppCheckerSignature<'a, S, H, HL, SL>

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> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
source§

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

§

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

§

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.
source§

impl<T, const L: usize> Client<L> for T
where T: ClientData<L> + ClientHash<L> + ClientVerify<L>,

source§

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

source§

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