pub struct RevocationReceipt {
pub receipt_id: [u8; 32],
pub grant_id: [u8; 32],
pub revoked_by: [u8; 32],
pub revoked_at: u64,
pub reason_hash: u64,
pub signature: [u8; 64],
}Expand description
An immutable revocation receipt permanently terminating a consent grant.
Fields§
§receipt_id: [u8; 32]§grant_id: [u8; 32]§revoked_by: [u8; 32]§revoked_at: u64§reason_hash: u64§signature: [u8; 64]Implementations§
Source§impl RevocationReceipt
impl RevocationReceipt
Sourcepub fn compute_digest(&self) -> [u8; 32]
pub fn compute_digest(&self) -> [u8; 32]
SHA-256 over the receipt’s identity fields (receipt_id,
grant_id, revoked_by, revoked_at, reason_hash) — the digest
that the principal’s signature commits to.
Sourcepub fn new_signed(
receipt_id: [u8; 32],
grant: &ConsentGrant,
revoking_key: &SigningKey,
revoked_at: u64,
reason_hash: u64,
) -> Self
pub fn new_signed( receipt_id: [u8; 32], grant: &ConsentGrant, revoking_key: &SigningKey, revoked_at: u64, reason_hash: u64, ) -> Self
Sign and construct a revocation receipt. Must be signed by the grant’s principal.
Sourcepub fn verify_against_grant(
&self,
grant: &ConsentGrant,
) -> Result<(), ConsentError>
pub fn verify_against_grant( &self, grant: &ConsentGrant, ) -> Result<(), ConsentError>
Verify signature and verify that the revoking actor matches the grant principal.
Sourcepub fn to_defeater_quin(
&self,
grant: &ConsentGrant,
category_flag: u32,
) -> NQuin
pub fn to_defeater_quin( &self, grant: &ConsentGrant, category_flag: u32, ) -> NQuin
Convert revocation receipt into a DEFEATER_BIT | OP_FORBID Deontic Super-Quin.
Trait Implementations§
Source§impl Clone for RevocationReceipt
impl Clone for RevocationReceipt
Source§impl Debug for RevocationReceipt
impl Debug for RevocationReceipt
Source§impl<'de> Deserialize<'de> for RevocationReceipt
impl<'de> Deserialize<'de> for RevocationReceipt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RevocationReceipt
Source§impl PartialEq for RevocationReceipt
impl PartialEq for RevocationReceipt
Source§impl Serialize for RevocationReceipt
impl Serialize for RevocationReceipt
impl StructuralPartialEq for RevocationReceipt
Auto Trait Implementations§
impl Freeze for RevocationReceipt
impl RefUnwindSafe for RevocationReceipt
impl Send for RevocationReceipt
impl Sync for RevocationReceipt
impl Unpin for RevocationReceipt
impl UnsafeUnpin for RevocationReceipt
impl UnwindSafe for RevocationReceipt
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more