[−][src]Struct asuran::repository::Key
Stores the Key material used by an asuran repository.
Contains 5 separate pieces of key material:
key
:
The key used for encryption/decryption operations
hmac_key
:
The key used for generating the integrity validation HMAC tag
id_key
:
The key used for ChunkID
generation using the HMAC
chunker_nonce
:
A random u64
used for chunker randomization with supported chunking algorithms
Implementations
impl Key
[src]
pub fn from_bytes(bytes: &[u8], chunker_nonce: u64) -> Key
[src]
Creates a key from the given array of bytes
Will split the key stream into thirds.
Does not perform any padding.
pub fn random(length: usize) -> Key
[src]
Securely generates a random bundle of key material
Takes the desired length in bytes of each individual key component
pub fn key(&self) -> &[u8]
[src]
Obtains a reference to the key bytes
pub fn hmac_key(&self) -> &[u8]
[src]
Obtains a reference to the HMAC key bytes
pub fn id_key(&self) -> &[u8]
[src]
Obtains a reference to the ID key bytes
pub fn chunker_nonce(&self) -> u64
[src]
Obtains the chunker nonce
Trait Implementations
impl Clone for Key
[src]
impl Debug for Key
[src]
impl<'de> Deserialize<'de> for Key
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Key, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Key, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Drop for Key
[src]
impl Eq for Key
[src]
impl PartialEq<Key> for Key
[src]
impl Serialize for Key
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for Key
[src]
impl StructuralPartialEq for Key
[src]
impl Zeroize for Key
[src]
Auto Trait Implementations
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,
fn with_current_subscriber(self) -> WithDispatch<Self>
[src]
impl<Z> Zeroize for Z where
Z: DefaultIsZeroes,
[src]
Z: DefaultIsZeroes,