pub struct Recipient {
pub name: String,
pub comment: Comment,
pub key_id: String,
pub fingerprint: Option<[u8; 20]>,
pub key_ring_status: KeyRingStatus,
pub trust_level: OwnerTrustLevel,
pub not_usable: bool,
}
Expand description
Represents one person on the team.
All secrets are encrypted with the key_id of the recipients.
Fields§
§name: String
Human readable name of the person.
comment: Comment
The comment field from the .gpg-id file, not including the leading ‘#’ characters.
key_id: String
Machine readable identity taken from the .gpg-id file, in the form of a gpg key id (16 hex chars) or a fingerprint (40 hex chars).
fingerprint: Option<[u8; 20]>
The fingerprint of the pgp key, as 20 bytes, if the fingerprint of the key is not known, this will be None.
key_ring_status: KeyRingStatus
The status of the key in GPG’s keyring
trust_level: OwnerTrustLevel
The trust level the owner of the key ring has placed in this person
not_usable: bool
If the key isn’t usable for any reason, i.e. if any of the gpg function
is_bad
, is_revoked
, is_expired
, is_disabled
or is_invalid
returns true
Implementations§
source§impl Recipient
impl Recipient
sourcepub fn from(
key_id: &str,
pre_comment: &[String],
post_comment: Option<String>,
crypto: &(dyn Crypto + Send)
) -> Result<Self>
pub fn from( key_id: &str, pre_comment: &[String], post_comment: Option<String>, crypto: &(dyn Crypto + Send) ) -> Result<Self>
Creates a Recipient
from a gpg key id string
Errors
Returns an Err
if the trust levels can’t be retrieved or there is something wrong with the fingerprint.
sourcepub fn all_recipients(
recipients_file: &Path,
crypto: &(dyn Crypto + Send)
) -> Result<Vec<Self>>
pub fn all_recipients( recipients_file: &Path, crypto: &(dyn Crypto + Send) ) -> Result<Vec<Self>>
Return a list of all the Recipients in the $PASSWORD_STORE_DIR/.gpg-id
file.
Errors
Returns an Err
if there is a problem reading the gpg_id file
sourcepub fn write_recipients_file(
recipients: &[Self],
recipients_file: &Path,
valid_gpg_signing_keys: &[[u8; 20]],
crypto: &(dyn Crypto + Send)
) -> Result<()>
pub fn write_recipients_file( recipients: &[Self], recipients_file: &Path, valid_gpg_signing_keys: &[[u8; 20]], crypto: &(dyn Crypto + Send) ) -> Result<()>
sourcepub fn remove_recipient_from_file(
s: &Self,
recipients_file: &Path,
valid_gpg_signing_keys: &[[u8; 20]],
crypto: &(dyn Crypto + Send)
) -> Result<()>
pub fn remove_recipient_from_file( s: &Self, recipients_file: &Path, valid_gpg_signing_keys: &[[u8; 20]], crypto: &(dyn Crypto + Send) ) -> Result<()>
Delete one of the persons from the list of team members to encrypt the passwords for.
Errors
Return an Err
if there is an error reading the gpg_id file