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
impl CredentialsLoading
Sourcepub fn new(
mapping: ExtendedUserMapping,
credentials: Vec<FullCredentials>,
errors: CredentialsLoadingErrors,
) -> Self
pub fn new( mapping: ExtendedUserMapping, credentials: Vec<FullCredentials>, errors: CredentialsLoadingErrors, ) -> Self
Creates a new CredentialsLoading
.
Sourcepub fn from_system_user() -> Result<Self, Error>
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.
Sourcepub fn get_mapping(&self) -> &ExtendedUserMapping
pub fn get_mapping(&self) -> &ExtendedUserMapping
Returns the ExtendedUserMapping
.
Sourcepub fn get_credentials(&self) -> &[FullCredentials]
pub fn get_credentials(&self) -> &[FullCredentials]
Returns all [FullCredentials
].
Sourcepub fn get_system_user_id(&self) -> Result<&SystemUserId, Error>
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.
Sourcepub fn has_userid_errors(&self) -> bool
pub fn has_userid_errors(&self) -> bool
Indicates whether there are any errors with [UserId
]s.
Returns true
if there are errors, false
otherwise.
Sourcepub fn get_userid_errors(self) -> CredentialsLoadingErrors
pub fn get_userid_errors(self) -> CredentialsLoadingErrors
Returns the collected errors for [UserId
]s.
Sourcepub fn has_signing_user(&self) -> bool
pub fn has_signing_user(&self) -> bool
Indicates whether the contained ExtendedUserMapping
is that of a signing user.
Sourcepub fn credentials_for_signing_user(self) -> Result<FullCredentials, Error>
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§
Auto Trait Implementations§
impl Freeze for CredentialsLoading
impl !RefUnwindSafe for CredentialsLoading
impl Send for CredentialsLoading
impl Sync for CredentialsLoading
impl Unpin for CredentialsLoading
impl !UnwindSafe for CredentialsLoading
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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