[−][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]
pub fn new(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>
) -> Self
[src]
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>
) -> 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 + ?Sized>(
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>,
rng: &mut R
) -> Self
[src]
authcid: &'a str,
password: &'a str,
authzid: Option<&'a str>,
rng: &mut 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]
Returns the next state and the first client message.
Call the
ServerFirst::handle_server_first
method to continue the SCRAM handshake.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,