pub struct ProofVerifier { /* private fields */ }Expand description
Verifies proof tokens for store mutations.
Implementations§
Source§impl ProofVerifier
impl ProofVerifier
Sourcepub fn new(policy: ProofPolicy) -> Self
pub fn new(policy: ProofPolicy) -> Self
Creates a new proof verifier with the given policy.
Sourcepub const fn policy(&self) -> &ProofPolicy
pub const fn policy(&self) -> &ProofPolicy
Returns the proof policy.
Sourcepub fn verify(
&mut self,
proof: &ProofToken,
expected_mutation_hash: &[u8; 32],
current_time_ns: u64,
capability: &Capability,
) -> Result<ProofAttestation>
pub fn verify( &mut self, proof: &ProofToken, expected_mutation_hash: &[u8; 32], current_time_ns: u64, capability: &Capability, ) -> Result<ProofAttestation>
Verifies a proof token for a mutation.
§Arguments
proof- The proof token to verifyexpected_mutation_hash- Hash of the mutation being authorizedcurrent_time_ns- Current time in nanosecondscapability- The capability being used (must have PROVE right)
§Returns
On success, returns a ProofAttestation to be logged.
On failure, returns ProofRejected.
Sourcepub const fn verifier_version(&self) -> u32
pub const fn verifier_version(&self) -> u32
Returns the verifier version.
Sourcepub const fn nonce_tracker(&self) -> &NonceTracker
pub const fn nonce_tracker(&self) -> &NonceTracker
Returns the nonce tracker.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProofVerifier
impl RefUnwindSafe for ProofVerifier
impl Send for ProofVerifier
impl Sync for ProofVerifier
impl Unpin for ProofVerifier
impl UnsafeUnpin for ProofVerifier
impl UnwindSafe for ProofVerifier
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