pub struct ScramClient { /* private fields */ }Expand description
SCRAM-SHA-256 client implementation
Implementations§
Source§impl ScramClient
impl ScramClient
Sourcepub fn client_first(&self) -> String
pub fn client_first(&self) -> String
Generate client first message (no proof)
Sourcepub fn client_final(
&mut self,
server_first: &str,
) -> Result<(String, ScramState), ScramError>
pub fn client_final( &mut self, server_first: &str, ) -> Result<(String, ScramState), ScramError>
Process server first message and generate client final message
Returns (client_final_message, internal_state)
§Errors
Returns ScramError::InvalidServerMessage if the server message cannot be parsed,
the server nonce does not start with the client nonce, or the iteration count is
invalid or exceeds MAX_SCRAM_ITERATIONS. Returns ScramError::Base64Error if
the salt is not valid base64.
Sourcepub fn verify_server_final(
&self,
server_final: &str,
state: &ScramState,
) -> Result<(), ScramError>
pub fn verify_server_final( &self, server_final: &str, state: &ScramState, ) -> Result<(), ScramError>
Verify server final message and confirm authentication
§Errors
Returns ScramError::InvalidServerMessage if the server final message is malformed.
Returns ScramError::Base64Error if the server signature is not valid base64.
Returns ScramError::AuthenticationFailed if the server signature does not match.
Auto Trait Implementations§
impl Freeze for ScramClient
impl RefUnwindSafe for ScramClient
impl Send for ScramClient
impl Sync for ScramClient
impl Unpin for ScramClient
impl UnsafeUnpin for ScramClient
impl UnwindSafe for ScramClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more