#[non_exhaustive]pub struct AlgorithmProperties {
pub primitive: CryptoPrimitive,
pub algorithm_family: Option<String>,
pub parameter_set_identifier: Option<String>,
pub mode: Option<CryptoMode>,
pub padding: Option<CryptoPadding>,
pub crypto_functions: Vec<CryptoFunction>,
pub execution_environment: Option<ExecutionEnvironment>,
pub implementation_platform: Option<ImplementationPlatform>,
pub certification_level: Vec<CertificationLevel>,
pub classical_security_level: Option<u32>,
pub nist_quantum_security_level: Option<u8>,
pub elliptic_curve: Option<String>,
}Expand description
Properties of a cryptographic algorithm asset.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.primitive: CryptoPrimitiveCryptographic primitive category.
algorithm_family: Option<String>Algorithm family name (e.g., “AES”, “ML-KEM”, “SHA-2”). CycloneDX 1.7+.
parameter_set_identifier: Option<String>Parameter set identifier (e.g., “256”, “1024”, “P-384”).
mode: Option<CryptoMode>Block cipher mode of operation.
padding: Option<CryptoPadding>Padding scheme.
crypto_functions: Vec<CryptoFunction>Cryptographic functions this algorithm supports.
execution_environment: Option<ExecutionEnvironment>Execution environment.
implementation_platform: Option<ImplementationPlatform>Implementation platform.
certification_level: Vec<CertificationLevel>Certification levels achieved.
classical_security_level: Option<u32>Classical security level in bits.
nist_quantum_security_level: Option<u8>NIST post-quantum security category (0 = vulnerable, 1-5 = increasing resistance).
elliptic_curve: Option<String>Elliptic curve identifier (CycloneDX 1.7+, e.g., “secg/secp521r1”).
Implementations§
Source§impl AlgorithmProperties
impl AlgorithmProperties
Sourcepub fn new(primitive: CryptoPrimitive) -> Self
pub fn new(primitive: CryptoPrimitive) -> Self
Create new algorithm properties with the given primitive.
Sourcepub fn is_quantum_safe(&self) -> bool
pub fn is_quantum_safe(&self) -> bool
Returns true if this algorithm has post-quantum security
(nistQuantumSecurityLevel > 0).
Sourcepub fn is_hybrid_pqc(&self) -> bool
pub fn is_hybrid_pqc(&self) -> bool
Returns true if this is a hybrid PQC scheme (combiner primitive).
Sourcepub fn is_weak(&self) -> bool
pub fn is_weak(&self) -> bool
Returns true if the algorithm is considered broken or weak.
Checks algorithm_family first, then falls back to matching
common weak names in the parameter_set_identifier.
Sourcepub fn is_weak_by_name(&self, component_name: &str) -> bool
pub fn is_weak_by_name(&self, component_name: &str) -> bool
Returns true if the algorithm is considered broken or weak,
using the component name as a fallback when algorithm_family is absent.
Sourcepub fn effective_security_bits(&self) -> Option<u32>
pub fn effective_security_bits(&self) -> Option<u32>
Returns the classical security level in bits, if known.
pub fn with_algorithm_family(self, family: String) -> Self
pub fn with_parameter_set_identifier(self, id: String) -> Self
pub fn with_mode(self, mode: CryptoMode) -> Self
pub fn with_padding(self, padding: CryptoPadding) -> Self
pub fn with_crypto_functions(self, funcs: Vec<CryptoFunction>) -> Self
pub fn with_execution_environment(self, env: ExecutionEnvironment) -> Self
pub fn with_implementation_platform( self, platform: ImplementationPlatform, ) -> Self
pub fn with_certification_level(self, levels: Vec<CertificationLevel>) -> Self
pub fn with_classical_security_level(self, bits: u32) -> Self
pub fn with_nist_quantum_security_level(self, level: u8) -> Self
pub fn with_elliptic_curve(self, curve: String) -> Self
Trait Implementations§
Source§impl Clone for AlgorithmProperties
impl Clone for AlgorithmProperties
Source§fn clone(&self) -> AlgorithmProperties
fn clone(&self) -> AlgorithmProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlgorithmProperties
impl Debug for AlgorithmProperties
Source§impl<'de> Deserialize<'de> for AlgorithmProperties
impl<'de> Deserialize<'de> for AlgorithmProperties
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AlgorithmProperties
impl PartialEq for AlgorithmProperties
Source§impl Serialize for AlgorithmProperties
impl Serialize for AlgorithmProperties
impl Eq for AlgorithmProperties
impl StructuralPartialEq for AlgorithmProperties
Auto Trait Implementations§
impl Freeze for AlgorithmProperties
impl RefUnwindSafe for AlgorithmProperties
impl Send for AlgorithmProperties
impl Sync for AlgorithmProperties
impl Unpin for AlgorithmProperties
impl UnsafeUnpin for AlgorithmProperties
impl UnwindSafe for AlgorithmProperties
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more