pub struct PBEHeader { /* private fields */ }Expand description
The pbe header contains all informations for the encryption of the encryption key.
The encryption key, used for the chunk encryption, can be found at the EncryptionHeader -
encrypted with an user password.
This encryption of the encryption key is done via a password-based encryption (PBE).
All metadata about this PBE can be found in this PBEHeader.\
Implementations
sourceimpl PBEHeader
impl PBEHeader
sourcepub fn new(
version: u8,
kdf_scheme: KDFScheme,
encryption_scheme: PBEScheme,
kdf_parameters: KDFParameters,
pbencryption_nonce: [u8; 16]
) -> PBEHeader
pub fn new(
version: u8,
kdf_scheme: KDFScheme,
encryption_scheme: PBEScheme,
kdf_parameters: KDFParameters,
pbencryption_nonce: [u8; 16]
) -> PBEHeader
returns a new pbe header with the given values.
sourcepub fn kdf_scheme(&self) -> &KDFScheme
pub fn kdf_scheme(&self) -> &KDFScheme
returns the kdf scheme.
sourcepub fn encryption_scheme(&self) -> &PBEScheme
pub fn encryption_scheme(&self) -> &PBEScheme
returns the encryption scheme.
sourcepub fn kdf_parameters(&self) -> &KDFParameters
pub fn kdf_parameters(&self) -> &KDFParameters
returns the kdf parameters.
Trait Implementations
sourceimpl HeaderCoding for PBEHeader
impl HeaderCoding for PBEHeader
sourcefn identifier() -> u32
fn identifier() -> u32
returns the identifier (=Magic bytes) of the header.
sourcefn encode_header(&self) -> Vec<u8>
fn encode_header(&self) -> Vec<u8>
encodes the header.
sourcefn header_size(&self) -> usize
fn header_size(&self) -> usize
returns the size of the encoded header (in bytes)
sourcefn encode_directly(&self) -> Vec<u8>
fn encode_directly(&self) -> Vec<u8>
encodes the (header) value/object directly (= without key).
sourcefn encode_for_key<K: Into<String>>(&self, key: K) -> Vec<u8>
fn encode_for_key<K: Into<String>>(&self, key: K) -> Vec<u8>
encodes a key to the (header) value/object.
sourcefn decode_header_length<R: Read>(data: &mut R) -> Result<u64>
fn decode_header_length<R: Read>(data: &mut R) -> Result<u64>
decodes the length of the header.
sourcefn check_identifier<R: Read>(data: &mut R) -> bool
fn check_identifier<R: Read>(data: &mut R) -> bool
checks if the read identifier is valid for this header.
impl Eq for PBEHeader
impl StructuralEq for PBEHeader
impl StructuralPartialEq for PBEHeader
Auto Trait Implementations
impl RefUnwindSafe for PBEHeader
impl Send for PBEHeader
impl Sync for PBEHeader
impl Unpin for PBEHeader
impl UnwindSafe for PBEHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more