pub struct AppCheckerSignature<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: 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 SIGNATURE_LEN).
Implementations§
Source§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
pub fn new( hasher: &'a H, verifier: &'a S, hash_buffer: &'static mut [u8; HASH_LEN], signature_buffer: &'static mut [u8; SIGNATURE_LEN], credential_type: TbfFooterV2CredentialsType, ) -> AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Trait Implementations§
Source§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> AppCredentialsPolicy<'static> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> AppCredentialsPolicy<'static> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Source§fn require_credentials(&self) -> bool
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])>
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>)
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, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientData<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientData<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Source§fn add_mut_data_done(
&self,
_result: Result<(), ErrorCode>,
_data: SubSliceMut<'static, u8>,
)
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 moreSource§fn add_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSlice<'static, u8>,
)
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 moreSource§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientHash<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientHash<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Source§fn hash_done(
&self,
result: Result<(), ErrorCode>,
digest: &'static mut [u8; HASH_LEN],
)
fn hash_done( &self, result: Result<(), ErrorCode>, digest: &'static mut [u8; HASH_LEN], )
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 moreSource§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientVerify<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientVerify<HASH_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Source§fn verification_done(
&self,
_result: Result<bool, ErrorCode>,
_compare: &'static mut [u8; HASH_LEN],
)
fn verification_done( &self, _result: Result<bool, ErrorCode>, _compare: &'static mut [u8; HASH_LEN], )
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 moreSource§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientVerify<HASH_LEN, SIGNATURE_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> ClientVerify<HASH_LEN, SIGNATURE_LEN> for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Source§impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> SelectKeyClient for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S: SignatureVerify<'static, HASH_LEN, SIGNATURE_LEN> + SelectKey<'a>, H: DigestDataHash<'a, HASH_LEN>, const HASH_LEN: usize, const SIGNATURE_LEN: usize> SelectKeyClient for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
Auto Trait Implementations§
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> !Freeze for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> !RefUnwindSafe for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> !Send for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> !Sync for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> Unpin for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
impl<'a, S, H, const HASH_LEN: usize, const SIGNATURE_LEN: usize> !UnwindSafe for AppCheckerSignature<'a, S, H, HASH_LEN, SIGNATURE_LEN>
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