pub struct Voa(LoadPathList);
Expand description
Access to the “File Hierarchy for the Verification of OS Artifacts (VOA)”.
Voa
provides lookup facilities for signature verifiers that are stored in a VOA hierarchy.
Lookup of verifiers is agnostic to the cryptographic technology later using the verifiers.
Tuple Fields§
§0: LoadPathList
Implementations§
Source§impl Voa
impl Voa
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Voa
instance.
The VOA instance is initialized with a set of load paths, either in system mode or user mode, based on the user id of the current process:
- For user ids < 1000, the VOA instance is initialized in system mode. See user mode.
- For user ids >= 1000, the VOA instance is initialized in user mode. See system mode.
Sourcepub fn lookup(
&self,
os: Os,
purpose: Purpose,
context: Context,
technology: Technology,
) -> BTreeMap<PathBuf, Vec<Verifier>>
pub fn lookup( &self, os: Os, purpose: Purpose, context: Context, technology: Technology, ) -> BTreeMap<PathBuf, Vec<Verifier>>
Find applicable signature verifiers for a set of identifiers.
Verifiers are found based on the provided Os
, Purpose
, Context
and
Technology
identifiers.
This searches all VOA load paths that apply in this VOA instance.
Warnings are emitted (via the Rust log
mechanism) for all unusable files and directories
in the subset of the VOA hierarchy specified by the set of identifiers.
Returns a map of “canonicalized path” to lists of Verifier
s.
The same canonicalized verifier path can potentially be found via multiple load paths.
This return type gives callers full transparency into what has been found.
§Note
Many callers may find it sufficient to just use the .keys()
of this result as a set
of verifier paths.
§Examples
use voa_core::{
Voa,
identifiers::{Context, Mode, Os, Purpose, Role, Technology},
};
let voa = Voa::new(); // Auto-detects System or User mode
let verifiers = voa.lookup(
Os::new("arch".parse()?, None, None, None, None),
Purpose::new(Role::Packages, Mode::ArtifactVerifier),
Context::Default,
Technology::Openpgp,
);