Struct mas_keystore::Encrypter
source · pub struct Encrypter { /* private fields */ }
Expand description
Helps encrypting and decrypting data
Implementations§
source§impl Encrypter
impl Encrypter
sourcepub fn encrypt_to_string(&self, decrypted: &[u8]) -> Result<String, Error>
pub fn encrypt_to_string(&self, decrypted: &[u8]) -> Result<String, Error>
Encrypt a payload to a self-contained base64-encoded string
§Errors
Will return Err
when the payload failed to encrypt
sourcepub fn decrypt_string(&self, encrypted: &str) -> Result<Vec<u8>, DecryptError>
pub fn decrypt_string(&self, encrypted: &str) -> Result<Vec<u8>, DecryptError>
Decrypt a payload from a self-contained base64-encoded string
§Errors
Will return Err
when the payload failed to decrypt
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encrypter
impl RefUnwindSafe for Encrypter
impl Send for Encrypter
impl Sync for Encrypter
impl Unpin for Encrypter
impl UnwindSafe for Encrypter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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