Start with signing outgoing mails

- Add a scheme on how to discover Husk signing keys. Siging keys mut be
  certified by the `local trust root` with a signature having a notation
  with a name equal to `signing_keys@husk-projet.org`.
- Fetch the key from the keystore.
- Expand `authenticate()` so that notation can be added to the
  signature.
- Add a test to create a signing key and fetch it from the keystore.
This commit is contained in:
Malte Meiboom
2026-06-10 15:00:33 +02:00
parent 44d00b262e
commit 1f89d40cd3
7 changed files with 621 additions and 10 deletions
+10
View File
@@ -26,6 +26,7 @@ pub struct HuskContext<'hc> {
pub policy: StandardPolicy<'hc>,
pub cert_store: CertStore<'hc>,
pub local_trust_root: Cert,
pub signing_key: Option<Cert>,
pub introducers: Vec<Introducer>,
pub keyservers: Vec<String>,
pub mail: MailContext<'hc>,
@@ -45,10 +46,19 @@ impl<'hc> HuskContext<'hc> {
let local_trust_root = crypto::get_local_trust_root(&cert_store)?;
let introducers = crypto::get_introducers(&cert_store, &policy, local_trust_root.fingerprint());
let signing_key = match crypto::get_signing_key(sequoia_home, &cert_store, &policy, &local_trust_root) {
Ok(Some(cert)) => Some(cert),
_ => {
log::warn!("No signing key found");
None
}
};
Ok(HuskContext {
policy,
cert_store,
local_trust_root,
signing_key,
introducers,
keyservers: config.get_keyservers(),
mail: MailContext::new(),
+3 -1
View File
@@ -83,7 +83,8 @@ impl Introducer {
cert,
crypto::Role::Introducer,
true,
Some(domains))
Some(domains),
None)
}
/// Remove an introducer.
@@ -101,6 +102,7 @@ impl Introducer {
cert,
crypto::Role::Introducer,
false,
None,
None)
}
}