Struct fernet::MultiFernet [−][src]
Implementations
impl MultiFernet
[src]
MultiFernet
encapsulates the encrypt operation with the first Fernet
instance and decryption with the Fernet
instances provided in order
until successful decryption or a DecryptionError
.
pub fn new(keys: Vec<Fernet>) -> MultiFernet
[src]
pub fn encrypt(&self, data: &[u8]) -> String
[src]
Encrypts data with the first Fernet
instance. Returns a value
(which is base64-encoded) that can be passed to MultiFernet::decrypt
.
pub fn decrypt(&self, token: &str) -> Result<Vec<u8>, DecryptionError>
[src]
Decrypts a ciphertext, using the Fernet
instances provided. Returns
either Ok(plaintext)
if decryption is successful or
Err(DecryptionError)
if no decryption was possible across the set of
fernet keys.
Trait Implementations
impl Clone for MultiFernet
[src]
fn clone(&self) -> MultiFernet
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for MultiFernet
impl Send for MultiFernet
impl Sync for MultiFernet
impl Unpin for MultiFernet
impl UnwindSafe for MultiFernet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,