pub struct HashContext { /* private fields */ }Expand description
Hash context for hash operations
Implementations§
Source§impl HashContext
impl HashContext
Sourcepub fn with_provider(provider: Box<dyn CryptoProvider>) -> Self
pub fn with_provider(provider: Box<dyn CryptoProvider>) -> Self
Create a new hash context with a provider
Sourcepub fn with_default_provider() -> Self
pub fn with_default_provider() -> Self
Create a new hash context with the default provider
Sourcepub fn set_provider(&mut self, provider: Box<dyn CryptoProvider>)
pub fn set_provider(&mut self, provider: Box<dyn CryptoProvider>)
Set the cryptographic provider
Sourcepub fn provider(&self) -> Option<&dyn CryptoProvider>
pub fn provider(&self) -> Option<&dyn CryptoProvider>
Get the current provider
Sourcepub fn hash(&mut self, algorithm: Algorithm, data: &[u8]) -> Result<Vec<u8>>
pub fn hash(&mut self, algorithm: Algorithm, data: &[u8]) -> Result<Vec<u8>>
Hash data using the specified algorithm
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the context is initialized
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HashContext
impl !RefUnwindSafe for HashContext
impl Send for HashContext
impl Sync for HashContext
impl Unpin for HashContext
impl UnsafeUnpin for HashContext
impl !UnwindSafe for HashContext
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