Struct CredentialsLoading

Source
pub struct CredentialsLoading {
    mapping: ExtendedUserMapping,
    credentials: Vec<FullCredentials>,
    errors: CredentialsLoadingErrors,
}
Expand description

A collection of credentials and credential loading errors for a system user.

Tracks a SystemUserId, zero or more [FullCredentials] mapped to it, as well as zero or more errors related to loading the passphrase for a [UserId].

Fields§

§mapping: ExtendedUserMapping§credentials: Vec<FullCredentials>§errors: CredentialsLoadingErrors

Implementations§

Source§

impl CredentialsLoading

Source

pub fn new( mapping: ExtendedUserMapping, credentials: Vec<FullCredentials>, errors: CredentialsLoadingErrors, ) -> Self

Creates a new CredentialsLoading.

Source

pub fn from_system_user() -> Result<Self, Error>

Creates a CredentialsLoading for the calling system user.

Uses the data of the calling system user to derive the specific mapping for it from the Signstar configuration (a HermeticParallelConfig). Then continues to retrieve the credentials for all associated [NetHsm] users of the mapping.

§Errors

Returns an error if

  • it is not possible to derive user data from the calling process,
  • if there is no user data for the calling process,
  • the Signstar configuration file does not exist,
  • it is not possible to load the Signstar configuration,
  • not exactly one user mapping exists for the calling system user,
  • or if credentials loading fails due to a severe error.
Source

pub fn get_mapping(&self) -> &ExtendedUserMapping

Returns the ExtendedUserMapping.

Source

pub fn get_credentials(&self) -> &[FullCredentials]

Returns all [FullCredentials].

Source

pub fn get_system_user_id(&self) -> Result<&SystemUserId, Error>

Returns a reference to a SystemUserId.

§Errors

Returns an error if there is no system user in the tracked mapping.

Source

pub fn has_userid_errors(&self) -> bool

Indicates whether there are any errors with [UserId]s.

Returns true if there are errors, false otherwise.

Source

pub fn get_userid_errors(self) -> CredentialsLoadingErrors

Returns the collected errors for [UserId]s.

Source

pub fn has_signing_user(&self) -> bool

Indicates whether the contained ExtendedUserMapping is that of a signing user.

Source

pub fn credentials_for_signing_user(self) -> Result<FullCredentials, Error>

Returns the credentials for a signing user.

§Errors

Returns an error if

  • the tracked user is not a signing user
  • errors occurred when loading the system user’s credentials
  • or there are no credentials for the system user.

Trait Implementations§

Source§

impl Debug for CredentialsLoading

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T