Struct Voa

Source
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

Source

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

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 Verifiers. 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,
);

Trait Implementations§

Source§

impl Debug for Voa

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Voa

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Voa

§

impl RefUnwindSafe for Voa

§

impl Send for Voa

§

impl Sync for Voa

§

impl Unpin for Voa

§

impl UnwindSafe for Voa

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.