pub struct SecurityPolicy {
pub constant_time: ConstantTimePolicy,
pub allow_legacy_algorithms: bool,
pub allow_sha1_signatures: bool,
}Expand description
User-tunable security policy switches paired with a Profile.
Fields§
§constant_time: ConstantTimePolicyTiming-hardening mode derived from Cargo features or parsed configuration.
allow_legacy_algorithms: boolWhether legacy algorithms may be used when allowed by build policy.
allow_sha1_signatures: boolWhether SHA-1 signatures may be accepted when allowed by build policy.
Implementations§
Source§impl SecurityPolicy
impl SecurityPolicy
Sourcepub fn compiled() -> Self
pub fn compiled() -> Self
Builds a SecurityPolicy from active Cargo feature flags at compile time.
§Arguments
This function takes no parameters.
§Returns
A policy struct whose fields reflect cfg!(feature = ...) for constant-time, legacy, and SHA-1 modes.
§Panics
This function does not panic.
Sourcepub fn validate(self) -> Result<()>
pub fn validate(self) -> Result<()>
Ensures policy flags are internally consistent (for example, strict constant-time vs legacy modes).
§Arguments
self— Policy snapshot to validate.
§Returns
Ok(()) when all invariants hold.
§Errors
Returns Error::UnsupportedFeature when strict constant-time is combined with disallowed legacy or SHA-1 modes.
§Panics
This function does not panic.
Trait Implementations§
Source§impl Clone for SecurityPolicy
impl Clone for SecurityPolicy
Source§fn clone(&self) -> SecurityPolicy
fn clone(&self) -> SecurityPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityPolicy
impl Debug for SecurityPolicy
Source§impl PartialEq for SecurityPolicy
impl PartialEq for SecurityPolicy
Source§fn eq(&self, other: &SecurityPolicy) -> bool
fn eq(&self, other: &SecurityPolicy) -> bool
self and other values to be equal, and is used by ==.