Struct Verifier

Source
pub struct Verifier {
    voa_location: VoaLocation,
    canonicalized: PathBuf,
}
Expand description

A Verifier points to a signature verifier in the file system.

It consists of the VoaLocation via which the verifier was obtained, and a canonicalized path to the actual verifier file.

Depending on the verifier Technology, a Verifier instance may represent, e.g.:

  • an individual, standalone signature verifier,
  • an individual verifier that acts as a trust anchor,
  • a certificate complete with its trust chain,
  • a set of individual verifiers in one shared data structure.

Fields§

§voa_location: VoaLocation

The logical VOA location via which the verifier was found

§canonicalized: PathBuf

Canonicalized path of the verifier file

Implementations§

Source§

impl Verifier

Source

pub(crate) fn new(voa_location: VoaLocation, canonicalized: PathBuf) -> Self

Creates a new Verifier.

§Note

Callers of this constructor must ensure that canonicalized contains a fully canonicalized filename, that the file exists, and that the naming and any potential symlinks involved conform to the constraints defined in the VOA specification.

Source

pub fn voa_location(&self) -> &VoaLocation

The VoaLocation that this verifier file was found through

Source

pub fn canonicalized(&self) -> &Path

Returns a reference to the canonicalized path for the file that this Verifier represents.

Source

pub(crate) fn filename(&self) -> Option<&OsStr>

Returns the optional file name part of the canonicalized path of this Verifier.

Source

pub fn open(&self) -> Result<File, Error>

Opens the file this Verifier represents as a File in read-only mode.

§Errors

Returns an error if the file (see Verifier::canonicalized) cannot be opened for reading.

Trait Implementations§

Source§

impl Clone for Verifier

Source§

fn clone(&self) -> Verifier

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Verifier

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.