Function load_from_dir

Source
pub fn load_from_dir(path: impl AsRef<Path>) -> Result<OpenPgpImport, Error>
Expand description

Creates an OpenPgpImport from a directory containing OpenPGP packet files.

Recursively collects all regular files in the directory, concatenates them and attempts to create a single [SignedPublicKey] from the accumulated data. Supports both binary and ASCII-armored data.

The collected regular files must be sorted in the order of an OpenPGP Transferable Public Key. Both flat and Arch Linux keyring structures are supported (see the import::destructured module documentation for details).

ยงErrors

Returns an error if

  • path is not a directory,
  • or a [SignedPublicKey] cannot be created from the accumulated data.