Expand description
Library for interacting with pass managed data
§Examples
Note: These examples assume that the environment variable PASSWORD_STORE_DIR
is set to point
to the tests/simple/
folder of this repository.
-
Retrieve a specific entry from the store
let entry = libpass::retrieve("folder/subsecret-a").unwrap(); assert_eq!(entry.name().unwrap(), "folder/subsecret-a");
-
Retrieve and decrypt a specific entry from the store
use libpass::StoreEntry; match libpass::retrieve("folder/subsecret-a").unwrap() { StoreEntry::File(entry) => { assert_eq!(entry.plain_io_ro().unwrap().as_ref(), "foobar123\n".as_bytes()) }, _ => panic!() }
Modules§
- file_io
- Different handles and utilities for working with files
Structs§
- Store
Directory Iter - An iterator that iterates over
&StoreEntries
contained in a directory and its subdirectories - Store
Directory Ref - A reference to a directory in the password store
- Store
File Ref - A reference to a file in the password store
Enums§
- Pass
Error - Errors that may returned by library functions
- Store
Entry - An entry in the password store
Constants§
- PASSWORD_
STORE_ DIR_ ENV - Environment variable that is interpreted when evaluating
password_store_dir()
Functions§
- list
- List all passwords in the password store in a flat data structure
- password_
store_ dir - The default password store directory.
- retrieve
- Retrieve the stored entry identified by pass_name
Type Aliases§
- Result
- Custom Result that is equivalent to
Result<T, PassError>
.