pub struct HybridCryptoEngine { /* private fields */ }Expand description
Hybrid crypto engine for encryption/decryption operations
Implementations§
Source§impl HybridCryptoEngine
impl HybridCryptoEngine
Sourcepub fn with_ssh_dir<P: AsRef<Path>>(ssh_dir: P) -> Self
pub fn with_ssh_dir<P: AsRef<Path>>(ssh_dir: P) -> Self
Create a new hybrid crypto engine with custom SSH directory
Sourcepub fn encrypt(
&self,
data: &[u8],
public_key_path: Option<&Path>,
metadata: FileMetadata,
) -> Result<Vec<u8>, HybridCryptoError>
pub fn encrypt( &self, data: &[u8], public_key_path: Option<&Path>, metadata: FileMetadata, ) -> Result<Vec<u8>, HybridCryptoError>
Encrypt data with hybrid encryption
Sourcepub fn decrypt(
&self,
encrypted_data: &[u8],
private_key_path: Option<&Path>,
) -> Result<(Vec<u8>, FileMetadata), HybridCryptoError>
pub fn decrypt( &self, encrypted_data: &[u8], private_key_path: Option<&Path>, ) -> Result<(Vec<u8>, FileMetadata), HybridCryptoError>
Hybrid decryption functionality
Sourcepub fn extract_public_key_info(
&self,
encrypted_data: &[u8],
) -> Result<(KeyAlgorithm, String), HybridCryptoError>
pub fn extract_public_key_info( &self, encrypted_data: &[u8], ) -> Result<(KeyAlgorithm, String), HybridCryptoError>
Extract public key information from an encrypted file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HybridCryptoEngine
impl RefUnwindSafe for HybridCryptoEngine
impl Send for HybridCryptoEngine
impl Sync for HybridCryptoEngine
impl Unpin for HybridCryptoEngine
impl UnwindSafe for HybridCryptoEngine
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> 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