Struct crypt_guard::encrypt::Encrypt
source · pub struct Encrypt;Implementations§
source§impl Encrypt
impl Encrypt
pub fn new() -> Self
pub fn generate_hmac(key: &[u8], data: &[u8]) -> Vec<u8>
pub fn append_hmac(encrypted_data: Vec<u8>, hmac: Vec<u8>) -> Vec<u8>
pub async fn save_encrypted_message( &self, message: &[u8], path: PathBuf ) -> Result<(), CryptError>
pub async fn encrypt( &self, public_key_path: PathBuf, encrypt: &str, action: ActionType, hmac_key: &[u8], nonce: Option<&[u8; 24]> ) -> Result<Vec<u8>, CryptError>
source§impl Encrypt
impl Encrypt
pub async fn encrypt_data( &self, data: &[u8], key: &[u8], hmac_secret: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn encrypt_file( &self, file_path: PathBuf, shared_secret: &dyn SharedSecretKem, hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn encrypt_msg( &self, message: &str, shared_secret: &dyn SharedSecretKem, hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
source§impl Encrypt
impl Encrypt
pub async fn encrypt_data_xchacha20( &self, data: &[u8], key: &[u8], nonce: &[u8; 24], hmac_secret: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn encrypt_file_xchacha20( &self, file_path: PathBuf, shared_secret: &dyn SharedSecretKem, nonce: &[u8; 24], hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn encrypt_msg_xchacha20( &self, message: &str, shared_secret: &dyn SharedSecretKem, nonce: &[u8; 24], hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
Auto Trait Implementations§
impl RefUnwindSafe for Encrypt
impl Send for Encrypt
impl Sync for Encrypt
impl Unpin for Encrypt
impl UnwindSafe for Encrypt
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