Struct ffsend_api::crypto::key_set::KeySet [−][src]
pub struct KeySet { /* fields omitted */ }Methods
impl KeySet[src]
impl KeySetpub fn new(secret: Vec<u8>, iv: [u8; 12]) -> Self[src]
pub fn new(secret: Vec<u8>, iv: [u8; 12]) -> SelfConstruct a new key, with the given secret and iv.
pub fn from(file: &RemoteFile, password: Option<&String>) -> Self[src]
pub fn from(file: &RemoteFile, password: Option<&String>) -> SelfCreate 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]
pub fn generate(derive: bool) -> SelfGenerate 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]
pub fn derive(&mut self)Derive a file, authentication and metadata key.
pub fn derive_auth_password(&mut self, pass: &str, url: &Url)[src]
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.
pub fn secret(&self) -> &[u8][src]
pub fn secret(&self) -> &[u8]Get the secret key.
pub fn secret_encoded(&self) -> String[src]
pub fn secret_encoded(&self) -> StringGet the secret key as URL-safe base64 encoded string.
pub fn iv(&self) -> &[u8][src]
pub fn iv(&self) -> &[u8]Get the input vector.
pub fn set_iv(&mut self, iv: [u8; 12])[src]
pub fn set_iv(&mut self, iv: [u8; 12])Set the input vector.
pub fn file_key(&self) -> Option<&Vec<u8>>[src]
pub fn file_key(&self) -> Option<&Vec<u8>>Get the file encryption key, if derived.
pub fn auth_key(&self) -> Option<&Vec<u8>>[src]
pub fn auth_key(&self) -> Option<&Vec<u8>>Get the authentication encryption key, if derived.
pub fn auth_key_encoded(&self) -> Option<String>[src]
pub fn auth_key_encoded(&self) -> Option<String>Get the authentication encryption key, if derived, as URL-safe base64 encoded string.
pub fn meta_key(&self) -> Option<&Vec<u8>>[src]
pub fn meta_key(&self) -> Option<&Vec<u8>>Get the metadata encryption key, if derived.
pub fn cipher() -> Cipher[src]
pub fn cipher() -> CipherGet the cipher type to use in combination with these keys.