[−][src]Struct ffsend_api::crypto::key_set::KeySet
Methods
impl KeySet
[src]
pub fn new(secret: Vec<u8>, iv: [u8; 12]) -> Self
[src]
Construct a new key, with the given secret
and iv
.
pub fn from(file: &RemoteFile, password: Option<&String>) -> Self
[src]
Create a key set from the given file ID and secret. This method may be used to create a key set based on a share URL.
pub fn generate(derive: bool) -> Self
[src]
Generate a secure new key.
If derive
is true
, file, authentication and metadata keys will be
derived from the generated secret.
pub fn derive(&mut self)
[src]
Derive a file, authentication and metadata key.
pub fn derive_auth_password(&mut self, pass: &str, url: &Url)
[src]
Derive an authentication key, with the given password and file URL. This method does not derive a (new) file and metadata key.
pub fn secret(&self) -> &[u8]
[src]
Get the secret key.
pub fn secret_encoded(&self) -> String
[src]
Get the secret key as URL-safe base64 encoded string.
pub fn iv(&self) -> &[u8]
[src]
Get the input vector.
pub fn set_iv(&mut self, iv: [u8; 12])
[src]
Set the input vector.
pub fn file_key(&self) -> Option<&Vec<u8>>
[src]
Get the file encryption key, if derived.
pub fn auth_key(&self) -> Option<&Vec<u8>>
[src]
Get the authentication encryption key, if derived.
pub fn auth_key_encoded(&self) -> Option<String>
[src]
Get the authentication encryption key, if derived, as URL-safe base64 encoded string.
pub fn meta_key(&self) -> Option<&Vec<u8>>
[src]
Get the metadata encryption key, if derived.
pub fn cipher() -> Cipher
[src]
Get the cipher type to use in combination with these keys.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Same for T
type Output = T
Should always be Self