pub struct TrustStore { /* private fields */ }Expand description
Trust store for managing trusted keys and certificates
The TrustStore manages the cryptographic keys and certificates used for plugin signature verification. It provides a secure storage mechanism for trusted publisher keys.
§Examples
use sklears_core::plugin::TrustStore;
let trust_store = TrustStore::new();
// In a real implementation, you would load keys from secure storage
// trust_store.load_from_file("trust_store.pem")?;Implementations§
Source§impl TrustStore
impl TrustStore
Sourcepub fn verify_signature(
&self,
_content_hash: &str,
signature: &DigitalSignature,
) -> Result<bool>
pub fn verify_signature( &self, _content_hash: &str, signature: &DigitalSignature, ) -> Result<bool>
Sourcepub fn get_publisher_trust(&self, publisher: &PublisherInfo) -> u8
pub fn get_publisher_trust(&self, publisher: &PublisherInfo) -> u8
Sourcepub fn add_trusted_key(&mut self, fingerprint: String, key_info: PublicKeyInfo)
pub fn add_trusted_key(&mut self, fingerprint: String, key_info: PublicKeyInfo)
Add a trusted public key to the store
§Arguments
fingerprint- The key fingerprintkey_info- Information about the public key
Sourcepub fn remove_trusted_key(&mut self, fingerprint: &str)
pub fn remove_trusted_key(&mut self, fingerprint: &str)
Sourcepub fn revoke_key(&mut self, fingerprint: String)
pub fn revoke_key(&mut self, fingerprint: String)
Revoke a key by adding it to the revocation list
§Arguments
fingerprint- The key fingerprint to revoke
Sourcepub fn is_key_revoked(&self, fingerprint: &str) -> bool
pub fn is_key_revoked(&self, fingerprint: &str) -> bool
Sourcepub fn load_from_file(&mut self, _path: &str) -> Result<()>
pub fn load_from_file(&mut self, _path: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for TrustStore
impl Clone for TrustStore
Source§fn clone(&self) -> TrustStore
fn clone(&self) -> TrustStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrustStore
impl Debug for TrustStore
Auto Trait Implementations§
impl Freeze for TrustStore
impl RefUnwindSafe for TrustStore
impl Send for TrustStore
impl Sync for TrustStore
impl Unpin for TrustStore
impl UnwindSafe for TrustStore
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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