pub struct SessionKey(/* private fields */);Expand description
A 256-bit session key, one per file.
Implementations§
Source§impl SessionKey
impl SessionKey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> SessionKey
pub fn from_bytes(bytes: [u8; 32]) -> SessionKey
Wrap raw bytes.
Sourcepub fn generate() -> SessionKey
pub fn generate() -> SessionKey
Draw a fresh session key from the OS CSPRNG.
Sourcepub fn from_password(auth: &Auth, password: &str) -> Result<SessionKey>
pub fn from_password(auth: &Auth, password: &str) -> Result<SessionKey>
Derive the file’s session key for chunk_type from a password.
Convenience over unwrap_password plus parse_auth.
Trait Implementations§
Source§impl Clone for SessionKey
impl Clone for SessionKey
Source§fn clone(&self) -> SessionKey
fn clone(&self) -> SessionKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SessionKey
Source§impl Debug for SessionKey
impl Debug for SessionKey
impl Eq for SessionKey
Source§impl PartialEq for SessionKey
impl PartialEq for SessionKey
impl StructuralPartialEq for SessionKey
Auto Trait Implementations§
impl Freeze for SessionKey
impl RefUnwindSafe for SessionKey
impl Send for SessionKey
impl Sync for SessionKey
impl Unpin for SessionKey
impl UnsafeUnpin for SessionKey
impl UnwindSafe for SessionKey
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