use crate::property::{Property, SizedProperty};
#[non_exhaustive]
pub struct Iterations;
impl SizedProperty<'_> for Iterations {
type Value = u32;
}
#[non_exhaustive]
pub struct Salt;
impl Property<'_> for Salt {
type Value = [u8];
}
#[non_exhaustive]
pub struct AlgorithmName;
impl Property<'_> for AlgorithmName {
type Value = str;
}
#[non_exhaustive]
pub struct ScramStoredPassword<'a> {
pub iterations: u32,
pub salt: &'a [u8],
pub stored_key: &'a [u8],
pub server_key: &'a [u8],
}
impl<'a> ScramStoredPassword<'a> {
#[must_use]
pub const fn new(
iterations: u32,
salt: &'a [u8],
stored_key: &'a [u8],
server_key: &'a [u8],
) -> Self {
Self {
iterations,
salt,
stored_key,
server_key,
}
}
}
impl<'a> Property<'a> for ScramStoredPassword<'static> {
type Value = ScramStoredPassword<'a>;
}
#[non_exhaustive]
pub struct ScramCachedPassword<'a> {
pub client_key: &'a [u8],
pub server_key: &'a [u8],
}
impl<'a> Property<'a> for ScramCachedPassword<'static> {
type Value = ScramCachedPassword<'a>;
}
#[non_exhaustive]
pub struct SaltedPassword;
impl Property<'_> for SaltedPassword {
type Value = [u8];
}