pub struct StoreFileRef {
pub path: PathBuf,
}Expand description
A reference to a file in the password store
Fields§
§path: PathBufAbsolute path to the referenced directory
Implementations§
Source§impl StoreFileRef
impl StoreFileRef
Sourcepub fn name(&self) -> Result<String>
pub fn name(&self) -> Result<String>
Retrieve the name of the store entry
The name is represented as a relative path from the store root and can be used to retrieve this
entry using retrieve.
Sourcepub fn encryption_keys(&self) -> Result<Vec<Key>>
pub fn encryption_keys(&self) -> Result<Vec<Key>>
Retrieve the encryption keys that are used to encrypt this file
This is a collection of gpg keys which are used as gpg recipients during encryption operations.
They are taken from a .gpg-id file that is automatically searched for adjecent to this file and
further up in the directory hierarchy.
§Example
If you already have a StoreFileRef, you can use this method like so:
assert_eq!(
store_file_ref.encryption_keys().unwrap()[0].id().unwrap(),
"8497251104B6F45F"
)Sourcepub fn cipher_io(&self) -> Result<CipherFile>
pub fn cipher_io(&self) -> Result<CipherFile>
Get an IO handle to the encrypted content of this file
Sourcepub fn plain_io_rw(&self) -> Result<RwPlainFile>
pub fn plain_io_rw(&self) -> Result<RwPlainFile>
Get a read-write IO handle to the plaintext content of this file
Sourcepub fn plain_io_ro(&self) -> Result<RoPlainFile>
pub fn plain_io_ro(&self) -> Result<RoPlainFile>
Get a read-only IO handle to the plaintext of this file
Trait Implementations§
Source§impl Clone for StoreFileRef
impl Clone for StoreFileRef
Source§fn clone(&self) -> StoreFileRef
fn clone(&self) -> StoreFileRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more