[−][src]Struct scram::client::ScramClient
The initial state of the SCRAM mechanism. It's the entry point for a SCRAM handshake.
Methods
impl<'a> ScramClient<'a>
[src]
impl<'a> ScramClient<'a>
pub fn new(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>
) -> Result<Self>
[src]
pub fn new(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>
) -> Result<Self>
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 ofauthcid
. Ifauthzid
isNone
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>(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>,
rng: R
) -> Self
[src]
pub fn with_rng<R: Rng>(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>,
rng: R
) -> Self
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 ofauthcid
. Ifauthzid
isNone
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]
pub fn client_first(self) -> (ServerFirst<'a>, String)
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]
impl<'a> Debug for ScramClient<'a>
Auto Trait Implementations
impl<'a> Send for ScramClient<'a>
impl<'a> Send for ScramClient<'a>
impl<'a> Sync for ScramClient<'a>
impl<'a> Sync for ScramClient<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more