pub struct GpgConfig {
pub format: GpgFormat,
pub program: String,
pub generic_program: Option<String>,
pub openpgp_program: Option<String>,
pub x509_program: Option<String>,
pub ssh_program: Option<String>,
pub signing_key: Option<String>,
pub min_trust_level: Option<TrustLevel>,
pub ssh_allowed_signers: Option<String>,
pub ssh_revocation_file: Option<String>,
}Expand description
Resolved signing/verification configuration.
Fields§
§format: GpgFormatThe selected format.
program: StringThe resolved program command for Self::format (used for signing; may
be a bare name to look up on $PATH).
generic_program: Option<String>gpg.program (the format-agnostic fallback), if set.
openpgp_program: Option<String>gpg.openpgp.program, if set.
x509_program: Option<String>gpg.x509.program, if set.
ssh_program: Option<String>gpg.ssh.program, if set.
signing_key: Option<String>user.signingkey, if set.
min_trust_level: Option<TrustLevel>gpg.minTrustLevel, if set.
ssh_allowed_signers: Option<String>gpg.ssh.allowedSignersFile, if set (path; leading ~/ expanded).
ssh_revocation_file: Option<String>gpg.ssh.revocationFile, if set (path; leading ~/ expanded).
Implementations§
Source§impl GpgConfig
impl GpgConfig
Sourcepub fn from_config(config: &ConfigSet) -> Result<GpgConfig>
pub fn from_config(config: &ConfigSet) -> Result<GpgConfig>
Read the signing configuration from a ConfigSet.
§Errors
Returns Error::ConfigError when gpg.format holds an unrecognized
value (Git rejects this case-sensitively).
Sourcepub fn resolve_signing_key(
&self,
key_override: Option<&str>,
committer_default: &str,
) -> String
pub fn resolve_signing_key( &self, key_override: Option<&str>, committer_default: &str, ) -> String
The signing key to use: the explicit key_override, else
user.signingkey, else the supplied committer identity (Git passes
git_committer_info(IDENT_STRICT | IDENT_NO_DATE)).
Sourcepub fn resolve_program_path(&self) -> Result<PathBuf>
pub fn resolve_program_path(&self) -> Result<PathBuf>
Resolve Self::program to an executable path.
Mirrors Git’s program resolution: a leading ~/ expands to $HOME, an
absolute path is used verbatim, and a bare name is searched on $PATH.