diff options
author | Heiko Schaefer <heiko@schaefer.name> | 2021-11-03 18:03:08 +0100 |
---|---|---|
committer | Heiko Schaefer <heiko@schaefer.name> | 2021-11-03 18:03:08 +0100 |
commit | f42783dc141106711259f8b9d6a9bb2f260e5b41 (patch) | |
tree | 5326d133c0ea1b2d17e9bc735524dffc7cafa004 | |
parent | 14ab361f85f50d4f9bf3a6106f61a8b5697f9c90 (diff) | |
download | openpgp-ca-f42783dc141106711259f8b9d6a9bb2f260e5b41.tar.gz |
Add command "user update" to cli tool.
-rw-r--r-- | openpgp-ca-bin/src/bin.rs | 4 | ||||
-rw-r--r-- | openpgp-ca-bin/src/cli.rs | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/openpgp-ca-bin/src/bin.rs b/openpgp-ca-bin/src/bin.rs index 441709b..b1b6040 100644 --- a/openpgp-ca-bin/src/bin.rs +++ b/openpgp-ca-bin/src/bin.rs @@ -76,6 +76,10 @@ fn main() -> Result<()> { None, )?; } + UserCommand::Update { cert_file } => { + let cert = std::fs::read_to_string(cert_file)?; + ca.cert_import_update(&cert)?; + } UserCommand::Export { email, path } => { if let Some(path) = path { ca.export_certs_as_files(email, &path)?; diff --git a/openpgp-ca-bin/src/cli.rs b/openpgp-ca-bin/src/cli.rs index 8265f61..e2accdd 100644 --- a/openpgp-ca-bin/src/cli.rs +++ b/openpgp-ca-bin/src/cli.rs @@ -171,6 +171,15 @@ pub enum UserCommand { )] revocation_file: Vec<PathBuf>, }, + /// Update User (use existing Public Key) + Update { + #[structopt( + short = "f", + long = "key-file", + help = "File that contains the User's Public Key" + )] + cert_file: PathBuf, + }, /// Export User Public Key (bulk, if no email address is given) Export { #[structopt(short = "e", long = "email", help = "Email address")] |