pub struct StoredKey {
pub iterations: usize,
pub salt: Vec<u8>,
pub stored_key: Sha256Out,
pub server_key: Sha256Out,
}Expand description
A stored SCRAM-SHA-256 key.
The SCRAM key format consists of several components separated by ‘$’ and ‘:’ characters:
"SCRAM-SHA-256$<iterations>:<salt>$<stored_key>:<server_key>"
Where:
iterations: Number of PBKDF2-HMAC-SHA256 iterations used for key derivationsalt: Base64-encoded cryptographically secure random salt used in key derivationstored_key: Hash of the client key, where client key is derived asSHA-256(HMAC-SHA-256(salted_password, "Client Key"))server_key: Server key derived asHMAC-SHA-256(salted_password, "Server Key")
The stored_key and server_key are pre-computed cryptographic values that
prevent storing the raw password while maintaining secure authentication.
The stored_key is a hash(hmac(P, ...)) used to verify client
authentication proofs, while the server_key is a hmac(P, ...) used to
generate server authentication signatures.
Fields§
§iterations: usize§salt: Vec<u8>§stored_key: Sha256Out§server_key: Sha256OutImplementations§
Trait Implementations§
Source§impl ServerEnvironment for StoredKey
impl ServerEnvironment for StoredKey
impl Eq for StoredKey
Auto Trait Implementations§
impl Freeze for StoredKey
impl RefUnwindSafe for StoredKey
impl Send for StoredKey
impl Sync for StoredKey
impl Unpin for StoredKey
impl UnwindSafe for StoredKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EncoderForExt for Twhere
T: ?Sized,
impl<T> EncoderForExt for Twhere
T: ?Sized,
Source§fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
F: 'static,
Self: EncoderFor<F>,
fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
F: 'static,
Self: EncoderFor<F>,
Convert this builder into a vector of bytes. This is generally
not the most efficient way to perform serialization.
Source§fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
F: 'static,
Self: EncoderFor<F>,
fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
F: 'static,
Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.
Source§fn encode_buffer_uninit<'a, F>(
&self,
buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
F: 'static,
Self: EncoderFor<F>,
fn encode_buffer_uninit<'a, F>(
&self,
buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
F: 'static,
Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.