SrpClient

Struct SrpClient 

Source
pub struct SrpClient<'a, D: Digest> { /* private fields */ }
Expand description

SRP client state before handshake with the server.

Implementations§

Source§

impl<'a, D: Digest> SrpClient<'a, D>

Source

pub fn new(params: &'a SrpGroup) -> Self

Create new SRP client instance.

Source

pub fn compute_a_pub(&self, a: &BigUint) -> BigUint

Source

pub fn compute_identity_hash(username: &[u8], password: &[u8]) -> Output<D>

Source

pub fn compute_x(identity_hash: &[u8], salt: &[u8]) -> BigUint

Source

pub fn compute_premaster_secret( &self, b_pub: &BigUint, k: &BigUint, x: &BigUint, a: &BigUint, u: &BigUint, ) -> BigUint

Source

pub fn compute_v(&self, x: &BigUint) -> BigUint

Source

pub fn compute_verifier( &self, username: &[u8], password: &[u8], salt: &[u8], ) -> Vec<u8>

Get password verifier (v in RFC5054) for user registration on the server.

Source

pub fn compute_public_ephemeral(&self, a: &[u8]) -> Vec<u8>

Get public ephemeral value for handshaking with the server. g^a % N

Source

pub fn process_reply( &self, a: &[u8], username: &[u8], password: &[u8], salt: &[u8], b_pub: &[u8], ) -> Result<SrpClientVerifier<D>, SrpAuthError>

Process server reply to the handshake. a is a random value, username, password is supplied by the user salt and b_pub come from the server

Auto Trait Implementations§

§

impl<'a, D> Freeze for SrpClient<'a, D>

§

impl<'a, D> RefUnwindSafe for SrpClient<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> Send for SrpClient<'a, D>
where D: Send,

§

impl<'a, D> Sync for SrpClient<'a, D>
where D: Sync,

§

impl<'a, D> Unpin for SrpClient<'a, D>
where D: Unpin,

§

impl<'a, D> UnwindSafe for SrpClient<'a, D>
where D: UnwindSafe,

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

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.