pub struct KeySet { /* private fields */ }
Implementations§
Source§impl KeySet
impl KeySet
Sourcepub fn new(secret: Vec<u8>, nonce: [u8; 12]) -> Self
pub fn new(secret: Vec<u8>, nonce: [u8; 12]) -> Self
Construct a new key, with the given secret
and nonce
.
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 Freeze for KeySet
impl RefUnwindSafe for KeySet
impl Send for KeySet
impl Sync for KeySet
impl Unpin for KeySet
impl UnwindSafe for KeySet
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