pub struct FiduciaryCrypto { /* private fields */ }Expand description
Fiduciary cryptographic operations
Implementations§
Source§impl FiduciaryCrypto
impl FiduciaryCrypto
Sourcepub fn generate_key(&mut self, key_id: String) -> Result<(), MlDsaError>
pub fn generate_key(&mut self, key_id: String) -> Result<(), MlDsaError>
Generate new key
Sourcepub fn sign(
&self,
message: &[u8],
key_id: Option<&str>,
domain: String,
purpose: String,
) -> Result<MlDsaSignature, MlDsaError>
pub fn sign( &self, message: &[u8], key_id: Option<&str>, domain: String, purpose: String, ) -> Result<MlDsaSignature, MlDsaError>
Sign message using the internal MlDsaSigner for the given key.
NOTE: The signing context uses timestamp=0 and nonce=[0] so that a matching
verify() call (which reconstructs the same deterministic context) will succeed.
A future upgrade to FIPS-204 ML-DSA should embed the context in the signature.
Sourcepub fn verify(
&self,
message: &[u8],
signature: &MlDsaSignature,
key_id: Option<&str>,
domain: String,
purpose: String,
) -> Result<bool, MlDsaError>
pub fn verify( &self, message: &[u8], signature: &MlDsaSignature, key_id: Option<&str>, domain: String, purpose: String, ) -> Result<bool, MlDsaError>
Verify a signature produced by sign() using the internal MlDsaSigner.
Sourcepub fn hash_token(&self, token: &[u8]) -> Result<[u8; 32], MlDsaError>
pub fn hash_token(&self, token: &[u8]) -> Result<[u8; 32], MlDsaError>
Hash a token into a 32-byte digest using SHA3-512 (first 32 bytes).
Sourcepub fn get_audit_log(&self) -> Vec<AuditEntry>
pub fn get_audit_log(&self) -> Vec<AuditEntry>
Get audit log
Sourcepub fn sign_with_managed_context(
&mut self,
message: &[u8],
key_id: Option<&str>,
domain: String,
purpose: String,
) -> Result<(MlDsaSignature, CryptoContext), MlDsaError>
pub fn sign_with_managed_context( &mut self, message: &[u8], key_id: Option<&str>, domain: String, purpose: String, ) -> Result<(MlDsaSignature, CryptoContext), MlDsaError>
Sign a message using a context managed by the internal ContextManager. Creates a fresh cryptographic context for the given domain/purpose and uses it to bind the signature.
Sourcepub fn should_rotate_key(
&self,
key_id: &str,
signature_count: u64,
key_age_seconds: u64,
) -> bool
pub fn should_rotate_key( &self, key_id: &str, signature_count: u64, key_age_seconds: u64, ) -> bool
Check if a key should be rotated according to the key manager’s policy.
Sourcepub fn check_quantum_readiness(&self) -> bool
pub fn check_quantum_readiness(&self) -> bool
Check quantum readiness of the compliance checker
Sourcepub fn context_manager(&self) -> &ContextManager
pub fn context_manager(&self) -> &ContextManager
Get context manager reference for inspection
Auto Trait Implementations§
impl Freeze for FiduciaryCrypto
impl RefUnwindSafe for FiduciaryCrypto
impl Send for FiduciaryCrypto
impl Sync for FiduciaryCrypto
impl Unpin for FiduciaryCrypto
impl UnsafeUnpin for FiduciaryCrypto
impl UnwindSafe for FiduciaryCrypto
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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