Struct sasl::mechanisms::Scram
[−]
[src]
pub struct Scram<S: ScramProvider> { /* fields omitted */ }
A struct for the SASL SCRAM-* and SCRAM-*-PLUS mechanisms.
Methods
impl<S: ScramProvider> Scram<S>
[src]
fn new<N: Into<String>, P: Into<String>>(username: N,
password: P,
channel_binding: ChannelBinding)
-> Result<Scram<S>, Error>
password: P,
channel_binding: ChannelBinding)
-> Result<Scram<S>, Error>
Constructs a new struct for authenticating using the SASL SCRAM-* and SCRAM-*-PLUS mechanisms, depending on the passed channel binding.
It is recommended that instead you use a Credentials
struct and turn it into the
requested mechanism using from_credentials
.
Trait Implementations
impl<S: ScramProvider> Mechanism for Scram<S>
[src]
fn name(&self) -> &str
The name of the mechanism.
fn from_credentials(credentials: Credentials) -> Result<Scram<S>, String>
Creates this mechanism from Credentials
.
fn initial(&mut self) -> Result<Vec<u8>, String>
Provides initial payload of the SASL mechanism.
fn response(&mut self, challenge: &[u8]) -> Result<Vec<u8>, String>
Creates a response to the SASL challenge.
fn success(&mut self, data: &[u8]) -> Result<(), String>
Verifies the server success response, if there is one.