pub struct KeyFile {
pub key: SecStr,
pub file_type: KeyFileType,
}
Expand description
A key file used for encrypting and decrypting the database.
Fields§
§key: SecStr
The key data.
file_type: KeyFileType
The type of key file.
Implementations§
Source§impl KeyFile
impl KeyFile
Sourcepub fn new_binary() -> Result<KeyFile>
pub fn new_binary() -> Result<KeyFile>
Attempts to create a new binary key file.
§Examples
use kpdb::KeyFile;
let key = KeyFile::new_binary()?;
Sourcepub fn new_hex() -> Result<KeyFile>
pub fn new_hex() -> Result<KeyFile>
Attempts to create a new hexadecimal key file.
§Examples
use kpdb::KeyFile;
let key = KeyFile::new_hex()?;
Trait Implementations§
impl StructuralPartialEq for KeyFile
Auto Trait Implementations§
impl Freeze for KeyFile
impl RefUnwindSafe for KeyFile
impl Send for KeyFile
impl Sync for KeyFile
impl Unpin for KeyFile
impl UnwindSafe for KeyFile
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