Struct sqrl_protocol::client_request::ClientParameters

source ·
pub struct ClientParameters {
    pub protocol_version: ProtocolVersion,
    pub command: ClientCommand,
    pub identity_key: VerifyingKey,
    pub options: Option<Vec<ClientOption>>,
    pub button: Option<u8>,
    pub previous_identity_key: Option<VerifyingKey>,
    pub index_secret: Option<String>,
    pub previous_index_secret: Option<String>,
    pub server_unlock_key: Option<String>,
    pub verify_unlock_key: Option<String>,
}
Expand description

Parameters used for sending requests to the client

Fields§

§protocol_version: ProtocolVersion

The supported protocol versions of the client (ver)

§command: ClientCommand

The client command requested to be performed (cmd)

§identity_key: VerifyingKey

The client identity used to sign the request (idk)

§options: Option<Vec<ClientOption>>

Optional options requested by the client (opt)

§button: Option<u8>

The button pressed in response to a server query (btn)

§previous_identity_key: Option<VerifyingKey>

A previous client identity used to sign the request (pidk)

§index_secret: Option<String>

The current identity indexed secret in response to a server query (ins)

§previous_index_secret: Option<String>

The previous identity indexed secret in response to a server query (pins)

§server_unlock_key: Option<String>

The server unlock key used for unlocking an identity (suk)

§verify_unlock_key: Option<String>

The verify unlock key used for unlocking an identity (vuk)

Implementations§

source§

impl ClientParameters

source

pub fn new( command: ClientCommand, identity_key: VerifyingKey ) -> ClientParameters

Create a new client parameter using the command and verifying key

source

pub fn from_base64(base64_string: &str) -> Result<Self, SqrlError>

Parse a base64-encoded client parameter value

source

pub fn to_base64(&self) -> String

base64-encode this client parameter object

source

pub fn validate(&self) -> Result<(), SqrlError>

Verify the client request is valid

Trait Implementations§

source§

impl Debug for ClientParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ClientParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for ClientParameters

§

type Err = SqrlError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for ClientParameters

source§

fn eq(&self, other: &ClientParameters) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ClientParameters

Auto Trait Implementations§

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

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.