Struct postgres_protocol::authentication::sasl::ScramSha256
source · pub struct ScramSha256 { /* private fields */ }
Expand description
A type which handles the client side of the SCRAM-SHA-256/SCRAM-SHA-256-PLUS authentication process.
During the authentication process, if the backend sends an AuthenticationSASL
message which
includes SCRAM-SHA-256
as an authentication mechanism, this type can be used.
After a ScramSha256
is constructed, the buffer returned by the message()
method should be
sent to the backend in a SASLInitialResponse
message along with the mechanism name.
The server will reply with an AuthenticationSASLContinue
message. Its contents should be
passed to the update()
method, after which the buffer returned by the message()
method
should be sent to the backend in a SASLResponse
message.
The server will reply with an AuthenticationSASLFinal
message. Its contents should be passed
to the finish()
method, after which the authentication process is complete.
Implementations§
source§impl ScramSha256
impl ScramSha256
sourcepub fn new(password: &[u8], channel_binding: ChannelBinding) -> ScramSha256
pub fn new(password: &[u8], channel_binding: ChannelBinding) -> ScramSha256
Constructs a new instance which will use the provided password for authentication.
sourcepub fn message(&self) -> &[u8] ⓘ
pub fn message(&self) -> &[u8] ⓘ
Returns the message which should be sent to the backend in an SASLResponse
message.