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
sourceimpl 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 RefUnwindSafe for KeyFile
impl Send for KeyFile
impl Sync for KeyFile
impl Unpin for KeyFile
impl UnwindSafe for KeyFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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