pub struct CryptographyMetrics {Show 25 fields
pub total_crypto_components: usize,
pub algorithms_count: usize,
pub certificates_count: usize,
pub keys_count: usize,
pub protocols_count: usize,
pub quantum_safe_count: usize,
pub quantum_vulnerable_count: usize,
pub weak_algorithm_count: usize,
pub hybrid_pqc_count: usize,
pub expired_certificates: usize,
pub expiring_soon_certificates: usize,
pub compromised_keys: usize,
pub inadequate_key_sizes: usize,
pub weak_algorithm_names: Vec<String>,
pub algorithms_with_oid: usize,
pub algorithms_with_family: usize,
pub algorithms_with_primitive: usize,
pub algorithms_with_security_level: usize,
pub certs_with_signature_algo_ref: usize,
pub keys_with_algorithm_ref: usize,
pub protocols_with_cipher_suites: usize,
pub keys_with_state: usize,
pub keys_with_protection: usize,
pub keys_with_lifecycle_dates: usize,
pub certs_with_validity_dates: usize,
}Expand description
Cryptographic asset metrics for quantum readiness and crypto hygiene assessment.
Computed from components with component_type == Cryptographic and
populated crypto_properties. Returns None for quality score when
no crypto components are present (N/A-aware).
Fields§
§total_crypto_components: usizeTotal number of cryptographic-asset components
algorithms_count: usizeNumber of algorithm assets
certificates_count: usizeNumber of certificate assets
keys_count: usizeNumber of key material assets
protocols_count: usizeNumber of protocol assets
quantum_safe_count: usizeAlgorithms with nistQuantumSecurityLevel > 0
quantum_vulnerable_count: usizeAlgorithms with nistQuantumSecurityLevel == 0
weak_algorithm_count: usizeAlgorithms flagged as weak/broken (MD5, SHA-1, DES, etc.)
hybrid_pqc_count: usizeHybrid PQC combiner algorithms
expired_certificates: usizeCertificates past notValidAfter
expiring_soon_certificates: usizeCertificates expiring within 90 days
compromised_keys: usizeKey material in compromised state
inadequate_key_sizes: usizeSymmetric keys < 128 bits or asymmetric keys below recommended minimum
weak_algorithm_names: Vec<String>Names of weak/broken algorithms found
algorithms_with_oid: usizeAlgorithms with an OID identifier
algorithms_with_family: usizeAlgorithms with algorithm_family set
algorithms_with_primitive: usizeAlgorithms with a recognized primitive (not Other)
algorithms_with_security_level: usizeAlgorithms with classical or quantum security level set
certs_with_signature_algo_ref: usizeCertificates with signature_algorithm_ref set
keys_with_algorithm_ref: usizeKeys with algorithm_ref set
protocols_with_cipher_suites: usizeProtocols with at least one cipher suite
keys_with_state: usizeKeys with state tracked
keys_with_protection: usizeKeys with secured_by protection
keys_with_lifecycle_dates: usizeKeys with creation_date or activation_date
certs_with_validity_dates: usizeCertificates with both not_valid_before and not_valid_after
Implementations§
Source§impl CryptographyMetrics
impl CryptographyMetrics
Sourcepub fn from_sbom(sbom: &NormalizedSbom) -> Self
pub fn from_sbom(sbom: &NormalizedSbom) -> Self
Compute cryptography metrics from an SBOM.
Sourcepub fn has_data(&self) -> bool
pub fn has_data(&self) -> bool
Whether any crypto components exist (i.e., CBOM data is present).
Sourcepub fn quantum_readiness_score(&self) -> Option<f32>
pub fn quantum_readiness_score(&self) -> Option<f32>
Percentage of algorithms that are quantum-safe (0-100).
Returns None when no algorithms are present: a 0/0 readiness is
absence of evidence, not a perfect score, and every renderer shows
it as “n/a” rather than a vacuous 100.
Sourcepub fn quality_score(&self) -> Option<f32>
pub fn quality_score(&self) -> Option<f32>
Quality score (0-100) based on crypto hygiene. Returns None if no crypto data.
Sourcepub fn crypto_completeness_score(&self) -> f32
pub fn crypto_completeness_score(&self) -> f32
Crypto completeness: how fully documented are the crypto assets?
Sourcepub fn crypto_identifier_score(&self) -> f32
pub fn crypto_identifier_score(&self) -> f32
Crypto identifier quality: OID coverage.
Sourcepub fn algorithm_strength_score(&self) -> f32
pub fn algorithm_strength_score(&self) -> f32
Algorithm strength: penalizes broken/weak/quantum-vulnerable algorithms.
Sourcepub fn crypto_dependency_score(&self) -> f32
pub fn crypto_dependency_score(&self) -> f32
Crypto dependency references: how well are cert/key/protocol -> algorithm refs resolved?
Sourcepub fn crypto_lifecycle_score(&self) -> f32
pub fn crypto_lifecycle_score(&self) -> f32
Crypto lifecycle: merged key management + certificate health.
Sourcepub fn pqc_readiness_score(&self) -> Option<f32>
pub fn pqc_readiness_score(&self) -> Option<f32>
PQC readiness: quantum migration preparedness.
Returns None when no algorithms are present — there is nothing to
be ready about, so the scorer redistributes this category’s weight
(mirroring vulnerability_score) instead of granting a vacuous 100.
Sourcepub fn quantum_readiness_pct(&self) -> f32
pub fn quantum_readiness_pct(&self) -> f32
Percentage of algorithms that are quantum-safe (for overview display).
Sourcepub const fn cbom_category_labels() -> [&'static str; 8]
pub const fn cbom_category_labels() -> [&'static str; 8]
Category labels for CBOM quality chart.
Sourcepub const fn cbom_category_names() -> [&'static str; 8]
pub const fn cbom_category_names() -> [&'static str; 8]
Full category names for CBOM quality scoring, in the same slot order
as Self::cbom_category_labels (the short chart labels) and as the
scorer’s CBOM slot substitution (scorer.rs). These are the names
serialized into diff QualityDelta categories for CBOM pairs and the
names the TUI’s CBOM category rows display — one category, one name.
Trait Implementations§
Source§impl Clone for CryptographyMetrics
impl Clone for CryptographyMetrics
Source§fn clone(&self) -> CryptographyMetrics
fn clone(&self) -> CryptographyMetrics
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 CryptographyMetrics
impl Debug for CryptographyMetrics
Source§impl Default for CryptographyMetrics
impl Default for CryptographyMetrics
Source§fn default() -> CryptographyMetrics
fn default() -> CryptographyMetrics
Source§impl<'de> Deserialize<'de> for CryptographyMetrics
impl<'de> Deserialize<'de> for CryptographyMetrics
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>,
Auto Trait Implementations§
impl Freeze for CryptographyMetrics
impl RefUnwindSafe for CryptographyMetrics
impl Send for CryptographyMetrics
impl Sync for CryptographyMetrics
impl Unpin for CryptographyMetrics
impl UnsafeUnpin for CryptographyMetrics
impl UnwindSafe for CryptographyMetrics
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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