pub struct AvatarUploadCredentialRequestContext { /* private fields */ }Implementations§
Source§impl AvatarUploadCredentialRequestContext
impl AvatarUploadCredentialRequestContext
Sourcepub fn new(
aci: Aci,
zk_credential_key_pair: &ZkCredentialKeyPair,
rotation_id: u64,
randomness: RandomnessBytes,
) -> Self
pub fn new( aci: Aci, zk_credential_key_pair: &ZkCredentialKeyPair, rotation_id: u64, randomness: RandomnessBytes, ) -> Self
Constructs a new request context.
zk_credential_key_pair is the account’s long-term Ristretto ZK credential key pair.
rotation_id is the server-chosen avatar slot rotation ID. The client already holds it (the
server returns it when the client sets its ZK credential key), so the client folds it into
the full commitment Cm = [aci]*H1 + [zk_credential_key_secret]*H2 + [rotation_id]*H3 here.
The server later verifies the well-formedness proof against its own rotation_id, which
forces the client to have used the server’s value.
pub fn get_request(&self) -> AvatarUploadCredentialRequest
Source§impl AvatarUploadCredentialRequestContext
impl AvatarUploadCredentialRequestContext
Sourcepub fn receive(
self,
response: AvatarUploadCredentialResponse,
params: &GenericServerPublicParams,
current_time: Timestamp,
) -> Result<AvatarUploadCredential, ZkGroupVerificationFailure>
pub fn receive( self, response: AvatarUploadCredentialResponse, params: &GenericServerPublicParams, current_time: Timestamp, ) -> Result<AvatarUploadCredential, ZkGroupVerificationFailure>
Verifies the issuing server’s response and produces a usable AvatarUploadCredential.
The server chose the redemption_time and embedded it in response. The client doesn’t
need to predict it, it only needs to confirm that the credential is usable now, since the
verifying server applies the same window (see AvatarUploadCredentialPresentation::verify).
current_time is the client’s view of wall-clock time; the redemption time must be day-aligned
and fall inside the redemption window relative to it.
Trait Implementations§
Source§impl Clone for AvatarUploadCredentialRequestContext
impl Clone for AvatarUploadCredentialRequestContext
Source§fn clone(&self) -> AvatarUploadCredentialRequestContext
fn clone(&self) -> AvatarUploadCredentialRequestContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for AvatarUploadCredentialRequestContext
impl<'de> Deserialize<'de> for AvatarUploadCredentialRequestContext
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>,
Source§impl PartialDefault for AvatarUploadCredentialRequestContext
impl PartialDefault for AvatarUploadCredentialRequestContext
Source§fn partial_default() -> Self
fn partial_default() -> Self
Auto Trait Implementations§
impl Freeze for AvatarUploadCredentialRequestContext
impl RefUnwindSafe for AvatarUploadCredentialRequestContext
impl Send for AvatarUploadCredentialRequestContext
impl Sync for AvatarUploadCredentialRequestContext
impl Unpin for AvatarUploadCredentialRequestContext
impl UnsafeUnpin for AvatarUploadCredentialRequestContext
impl UnwindSafe for AvatarUploadCredentialRequestContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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