Crate libpass

Source
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§

StoreDirectoryIter
An iterator that iterates over &StoreEntries contained in a directory and its subdirectories
StoreDirectoryRef
A reference to a directory in the password store
StoreFileRef
A reference to a file in the password store

Enums§

PassError
Errors that may returned by library functions
StoreEntry
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>.