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 is malformed or the nonce is invalid.
Returns ScramError::Base64Error if the salt encoding is invalid.
Returns ScramError::Utf8Error if HMAC key derivation fails.
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 missing the v= prefix.
Returns ScramError::Base64Error if the server signature encoding is invalid.
Returns ScramError::InvalidServerProof 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