Add examples for sq key subkey adopt.

This commit is contained in:
Neal H. Walfield 2024-06-12 18:14:23 +02:00
parent 78bab72166
commit 20d7b8ff68
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
2 changed files with 67 additions and 0 deletions

View File

@ -1174,6 +1174,29 @@ User ID."
pub binary: bool,
}
const ADOPT_EXAMPLES: Actions = Actions {
actions: &[
Action::Example(Example {
comment: "\
Import Alice's old key and new key.",
command: &[
"sq", "key", "import",
"alice-secret.pgp", "alice-new-secret.pgp",
],
}),
Action::Example(Example {
comment: "\
Have the new certificate adopt Alice's old authentication subkey.",
command: &[
"sq", "key", "adopt",
"--cert", "C5999E8191BF7B503653BE958B1F7910D01F86E5",
"--key", "0D45C6A756A038670FDFD85CB1C82E8D27DB23A1",
],
}),
]
};
test_examples!(sq_key_adopt, ADOPT_EXAMPLES);
#[derive(Debug, Args)]
#[clap(
name = "adopt",
@ -1195,6 +1218,7 @@ feasible.
$ sq key adopt --keyring juliet-old.pgp --key 0123456789ABCDEF \\
juliet-new.pgp
",
after_help = ADOPT_EXAMPLES,
)]
#[clap(group(ArgGroup::new("cert_input").args(&["cert_file", "cert"]).required(true)))]
pub struct AdoptCommand {

View File

@ -0,0 +1,43 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----
Comment: C599 9E81 91BF 7B50 3653 BE95 8B1F 7910 D01F 86E5
Comment: Alice <alice@example.org>
xVgEZmh5gBYJKwYBBAHaRw8BAQdAFO21J+GX0cgAUBhlGtG6rX6jiFCkyMZW0tS7
gIKayPoAAP90eMQL+DLCrihk05r3F144l3TDTv9fjZymQFnaUTHNmBGUwsALBB8W
CgB9BYJmaHmAAwsJBwkQix95ENAfhuVHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMu
c2VxdW9pYS1wZ3Aub3JnW9g5bFCkCqRCvilnWcw7v6JZVUXACV2r3QEFiQf0r9cD
FQoIApsBAh4BFiEExZmegZG/e1A2U76Vix95ENAfhuUAAMqqAP4xlvXtMrpjP+0h
m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