[][src]Struct scram::client::ScramClient

pub struct ScramClient<'a> { /* fields omitted */ }

The initial state of the SCRAM mechanism. It's the entry point for a SCRAM handshake.

Methods

impl<'a> ScramClient<'a>[src]

pub fn new(
    authcid: &'a str,
    password: &'a str,
    authzid: Option<&'a str>
) -> Self
[src]

Constructs an initial state for the SCRAM mechanism using the provided credentials.

Arguments

  • authcid - An username used for authentication.
  • password - A password used to prove that the user is authentic.
  • authzid - An username used for authorization. This can be used to impersonate as authzid using the credentials of authcid. If authzid is None the authorized username will be the same as the authenticated username.

Return value

An I/O error is returned if the internal random number generator couldn't be constructed.

pub fn with_rng<R: Rng + ?Sized>(
    authcid: &'a str,
    password: &'a str,
    authzid: Option<&'a str>,
    rng: &mut R
) -> Self
[src]

Constructs an initial state for the SCRAM mechanism using the provided credentials and a custom random number generator.

Arguments

  • authcid - An username used for authentication.
  • password - A password used to prove that the user is authentic.
  • authzid - An username used for authorization. This can be used to impersonate as authzid using the credentials of authcid. If authzid is None the authorized username will be the same as the authenticated username.
  • rng: A random number generator used to generate random nonces. Please only use a cryptographically secure random number generator!

pub fn client_first(self) -> (ServerFirst<'a>, String)[src]

Returns the next state and the first client message.

Call the ServerFirst::handle_server_first method to continue the SCRAM handshake.

Trait Implementations

impl<'a> Debug for ScramClient<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ScramClient<'a>

impl<'a> Send for ScramClient<'a>

impl<'a> Sync for ScramClient<'a>

impl<'a> Unpin for ScramClient<'a>

impl<'a> UnwindSafe for ScramClient<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,