pub struct Backup {
pub(crate) salt: Vec<u8>,
pub(crate) encrypted_version: Vec<u8>,
pub(crate) encrypted_domain_key: Vec<u8>,
pub(crate) items: Vec<Vec<u8>>,
}
Expand description
Data of a NetHSM backup.
This object contains the data of a successfully parsed and well-formed NetHSM backup.
Fields§
§salt: Vec<u8>
§encrypted_version: Vec<u8>
§encrypted_domain_key: Vec<u8>
§items: Vec<Vec<u8>>
Implementations§
source§impl Backup
impl Backup
sourcepub fn parse(reader: impl Read) -> Result<Self>
pub fn parse(reader: impl Read) -> Result<Self>
Parse the backup from a reader.
The reader must contain a well-formed, valid NetHSM backup file.
§Errors
Returns:
- Error::BadVersion if an unrecognized version value is found.
- Error::BadMagic if an unrecognized version value is found.
- Error::Io if an I/O error occurs when reading the backup.
sourcepub fn decrypt(&self, passphrase: &[u8]) -> Result<BackupDecryptor<'_>>
pub fn decrypt(&self, passphrase: &[u8]) -> Result<BackupDecryptor<'_>>
Create a BackupDecryptor
that will decrypt items with the provided passphrase.
§Errors
Even though this function returns a Result
it is unlikely to fail since all parameters are
static.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Backup
impl RefUnwindSafe for Backup
impl Send for Backup
impl Sync for Backup
impl Unpin for Backup
impl UnwindSafe for Backup
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