Add locals add and remove subcommands
- `locals add` adds a local (unintroduced) certificate for encryption. - `locals remove` removes/deacivates a local certificate. - Overall cleanup
This commit is contained in:
+15
-2
@@ -42,6 +42,7 @@ impl Introducer {
|
||||
}
|
||||
}
|
||||
|
||||
/// Has this introducer certified cert?
|
||||
pub fn is_introducing(&self, cert: &Cert) -> bool {
|
||||
|
||||
let policy = StandardPolicy::new();
|
||||
@@ -66,6 +67,7 @@ impl Introducer {
|
||||
result
|
||||
}
|
||||
|
||||
/// Create an introducer.
|
||||
pub fn create(context: &HuskContext, cert: &ValidCert, domains: Vec<String>)
|
||||
-> Result<()> {
|
||||
|
||||
@@ -75,9 +77,15 @@ impl Introducer {
|
||||
return Err(IntroducerError::UnsuitableCertificate.into());
|
||||
}
|
||||
|
||||
crypto::authenticate(context, cert, true, Some(domains))
|
||||
crypto::authenticate(
|
||||
context,
|
||||
cert,
|
||||
crypto::Role::Introducer,
|
||||
true,
|
||||
Some(domains))
|
||||
}
|
||||
|
||||
/// Remove an introducer.
|
||||
pub fn remove(context: &HuskContext, cert: &ValidCert, _demote: bool)
|
||||
-> Result<()> {
|
||||
|
||||
@@ -87,7 +95,12 @@ impl Introducer {
|
||||
return Err(IntroducerError::UnsuitableCertificate.into());
|
||||
}
|
||||
|
||||
crypto::authenticate(context, cert, false, None)
|
||||
crypto::authenticate(
|
||||
context,
|
||||
cert,
|
||||
crypto::Role::Introducer,
|
||||
false,
|
||||
None)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user