Struct ffsend_api::crypto::key_set::KeySet
source · pub struct KeySet { /* private fields */ }
Implementations
sourceimpl KeySet
impl KeySet
sourcepub fn new(secret: Vec<u8>, iv: [u8; 12]) -> Self
pub fn new(secret: Vec<u8>, iv: [u8; 12]) -> Self
Construct a new key, with the given secret
and iv
.
sourcepub fn from(file: &RemoteFile, password: Option<&String>) -> Self
pub fn from(file: &RemoteFile, password: Option<&String>) -> Self
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.
sourcepub fn generate(derive: bool) -> Self
pub fn generate(derive: bool) -> Self
Generate a secure new key.
If derive
is true
, file, authentication and metadata keys will be
derived from the generated secret.
sourcepub fn derive_auth_password(&mut self, pass: &str, url: &Url)
pub fn derive_auth_password(&mut self, pass: &str, url: &Url)
Derive an authentication key, with the given password and file URL. This method does not derive a (new) file and metadata key.
sourcepub fn secret_encoded(&self) -> String
pub fn secret_encoded(&self) -> String
Get the secret key as URL-safe base64 encoded string.
sourcepub fn auth_key_encoded(&self) -> Option<String>
pub fn auth_key_encoded(&self) -> Option<String>
Get the authentication encryption key, if derived, as URL-safe base64 encoded string.
Auto Trait Implementations
impl RefUnwindSafe for KeySet
impl Send for KeySet
impl Sync for KeySet
impl Unpin for KeySet
impl UnwindSafe for KeySet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more