Struct ffsend_api::crypto::key_set::KeySet
[−]
[src]
pub struct KeySet { /* fields omitted */ }
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.