use Key;
use crate;
use CookieConfig;
/// Derive an HMAC signing [`Key`] from a [`CookieConfig`].
///
/// # Errors
///
/// Returns [`Error::internal`] if `config.secret` is shorter than 64 characters,
/// which is the minimum required by the underlying HMAC implementation.
///
/// # Examples
///
/// ```rust,no_run
/// use modo::cookie::{CookieConfig, key_from_config};
///
/// let cfg = CookieConfig::new("a".repeat(64));
/// let key = key_from_config(&cfg).expect("secret must be at least 64 characters");
/// ```