pub struct PackageEncryptor { /* private fields */ }Expand description
Package encryptor for encrypting and decrypting packages
Implementations§
Source§impl PackageEncryptor
impl PackageEncryptor
Sourcepub fn new(algorithm: EncryptionAlgorithm) -> Self
pub fn new(algorithm: EncryptionAlgorithm) -> Self
Create a new package encryptor
Sourcepub fn encrypt_package_with_password(
&self,
package: &Package,
password: &str,
) -> Result<EncryptedPackage>
pub fn encrypt_package_with_password( &self, package: &Package, password: &str, ) -> Result<EncryptedPackage>
Encrypt a package with a password
Sourcepub fn decrypt_package_with_password(
&self,
encrypted: &EncryptedPackage,
password: &str,
) -> Result<Package>
pub fn decrypt_package_with_password( &self, encrypted: &EncryptedPackage, password: &str, ) -> Result<Package>
Decrypt a package with a password
Sourcepub fn save_encrypted<P: AsRef<Path>>(
encrypted: &EncryptedPackage,
path: P,
) -> Result<()>
pub fn save_encrypted<P: AsRef<Path>>( encrypted: &EncryptedPackage, path: P, ) -> Result<()>
Save encrypted package to file
Sourcepub fn load_encrypted<P: AsRef<Path>>(path: P) -> Result<EncryptedPackage>
pub fn load_encrypted<P: AsRef<Path>>(path: P) -> Result<EncryptedPackage>
Load encrypted package from file
Auto Trait Implementations§
impl Freeze for PackageEncryptor
impl RefUnwindSafe for PackageEncryptor
impl Send for PackageEncryptor
impl Sync for PackageEncryptor
impl Unpin for PackageEncryptor
impl UnsafeUnpin for PackageEncryptor
impl UnwindSafe for PackageEncryptor
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