Struct crypt_guard::Decrypt
source · pub struct Decrypt;Implementations§
source§impl Decrypt
impl Decrypt
pub fn new() -> Self
pub async fn generate_original_filename<'a>( &self, encrypted_path: &'a str ) -> String
pub fn extract_signature( signed_data: &[u8] ) -> Result<(Vec<u8>, DetachedSignature), CryptError>
pub fn verify_signature( &self, signature: DetachedSignature, message: &[u8], public_key: &PublicKey ) -> Result<bool, SigningErr>
pub fn verify_hmac( &self, key: &[u8], data_with_hmac: &[u8], hmac_len: usize ) -> Result<Vec<u8>, &'static str>
pub fn extract_encrypted_message( &self, message: &str ) -> Result<Vec<u8>, CryptError>
pub async fn decrypt( &self, secret_key: PathBuf, ciphertext: PathBuf, decrypt: &str, action: ActionType, hmac_key: &[u8], nonce: Option<&[u8; 24]> ) -> Result<(), CryptError>
source§impl Decrypt
impl Decrypt
pub async fn decrypt_data( &self, data: &[u8], key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn decrypt_file( &self, encrypted_file_path: &PathBuf, key: &dyn SharedSecret, hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn decrypt_msg( &self, encrypted_data_with_hmac: &[u8], key: &dyn SharedSecret, hmac_key: &[u8], safe: bool ) -> Result<String, CryptError>
source§impl Decrypt
impl Decrypt
pub async fn decrypt_data_xchacha20( &self, encrypted_data: &[u8], nonce: &[u8; 24], key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn decrypt_file_xchacha20( &self, encrypted_file_path: &PathBuf, key: &dyn SharedSecret, nonce: &[u8; 24], hmac_key: &[u8] ) -> Result<Vec<u8>, CryptError>
pub async fn decrypt_msg_xchacha20( &self, encrypted_data_with_hmac: &[u8], key: &dyn SharedSecret, nonce: &[u8; 24], hmac_key: &[u8], safe: bool ) -> Result<String, CryptError>
Auto Trait Implementations§
impl RefUnwindSafe for Decrypt
impl Send for Decrypt
impl Sync for Decrypt
impl Unpin for Decrypt
impl UnwindSafe for Decrypt
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