/// A optional set of identifiers given by the user. The user must be trusted to set/edit this value.
ident: post::Ident,
/// The public keys associated with this user.
///
/// # Trust
/// Each public key must have a corresponding signature in its complemental entry in `id_sig` to be considered trusted.
/// A user with no trusted public keys can be anyone or multiple people. This is not *disallowed* usually but should be discouraged.
///
/// Users are only considered trusted if they have at least one trusted public key.
pubkey: Vec<RsaPublicKey>,
/// This vector contains the complemental signature (and salt used with `id` to produce the signed hash) to the public keys in `pubkey`. Each element of `pubkey` must have a complemental element in this vector.
///
/// # Trusted public keys
/// `None` values for this are signatures that have not yet been produces for a given salt, and do not count as complete. Public keys in `pubkey` that do not have a corresponding `Some` signature value in this field should not be trusted.
id_sig: Vec<(UserSalt,Option<Signature>)>,
}
implHashforUser{
fnhash<H: Hasher>(&self,state: &mutH){
self.id.hash(state)
}
}
implBorrow<UserID>forUser
{
fnborrow(&self)-> &UserID
{
&self.id
}
}
implUser
{
/// Is this user a trusted user?
///
/// Does this user have at least one trusted public key (they have produced a valid signature specified in `id_sig`).
.with_warning(||"This could indicate key or signature corruption. This key or signature may need to be removed.")
.with_suggestion(||"If the user is unable to produce a verifyable signature for this public key despite haiving access to the private key, the key may be corrupted and may need to be removed and replaced.")
.wrap_err(eyre!("Failed to verify embedded signature of salted+hashed ID to complementary public key"))?{