Commit Graph

617 Commits

Author SHA1 Message Date
Neal H. Walfield
87eb10afff
Don't overwrite after_help_long, append to it.
- For subcommands, we append the message "See 'sq --help' for a
    description of the global options" to the `--help` output by setting
    the command's `after_help_long` attribute.

  - This overwrites any existing string.  In particular, we currently
    use this for showing examples.

  - Append the message to the existing message, if any.
2024-06-14 18:12:43 +02:00
Neal H. Walfield
ae392296f5
Add a top-level --password-file argument to seed the password cache.
- `sq key password`, and `sq sign --symmetric` have local arguments
    to seed the password cache.

  - Many commands could benefit from similar functionality.

  - Add a new top-level argument, `--password-file`, to seed the
    password cache.
2024-06-13 11:39:09 +02:00
Neal H. Walfield
2ed7435b63
Rename sq key password's --clear argument to --clear-password.
- This makes the argument's intent clearer and more closely mirrors
    the other arguments, like `--new-password-file`.
2024-06-13 10:56:10 +02:00
Neal H. Walfield
02cd47c6e3
Improve sq key's --help. 2024-06-13 10:48:12 +02:00
Neal H. Walfield
61e8b8b5ff
Improve sq key userid strip's --help. 2024-06-13 10:47:02 +02:00
Neal H. Walfield
21d3fdc554
Improve sq key subkey revoke's --help. 2024-06-13 10:47:02 +02:00
Neal H. Walfield
378dec8e10
Add examples for sq key subkey revoke. 2024-06-13 10:47:02 +02:00
Neal H. Walfield
1cb06754c0
Improve sq key subkey expire's --help. 2024-06-13 10:47:01 +02:00
Neal H. Walfield
6b84d2db79
Improve examples for sq key subkey expire. 2024-06-13 10:47:01 +02:00
Neal H. Walfield
d65cb0e078
Improve sq key subkey add's --help. 2024-06-13 10:47:01 +02:00
Neal H. Walfield
786f5ec0a4
Add examples for sq key subkey add. 2024-06-13 10:47:01 +02:00
Neal H. Walfield
3b979db2c1
Improve sq key subkey's --help. 2024-06-13 10:47:00 +02:00
Neal H. Walfield
7284786d7a
Improve sq key attest-certifications's --help. 2024-06-13 10:47:00 +02:00
Neal H. Walfield
e284bcca46
Port sq key attest-certifications's examples to the example framework.
- Port `sq key attest-certifications`'s examples to the example
    framework and improve the examples.

  - See #196.
2024-06-13 10:47:00 +02:00
Neal H. Walfield
18f4e229d0
Improve sq key subkey adopt's --help. 2024-06-13 10:47:00 +02:00
Neal H. Walfield
20d7b8ff68
Add examples for sq key subkey adopt. 2024-06-13 10:47:00 +02:00
Neal H. Walfield
78bab72166
Improve sq key userid revoke's --help. 2024-06-13 10:46:59 +02:00
Neal H. Walfield
a369d4996b
Add examples for sq key userid revoke. 2024-06-13 10:46:59 +02:00
Neal H. Walfield
122d9192d1
Improve sq key userid add's --help. 2024-06-13 10:46:59 +02:00
Neal H. Walfield
a9b400060d
Port sq key userid add's examples to the example framework.
- Port `sq key userid add`'s examples to the example framework and
    improve the examples.

  - See #196.
2024-06-13 10:46:59 +02:00
Neal H. Walfield
acc0376b43
Improve sq key userid's --help. 2024-06-13 10:46:58 +02:00
Neal H. Walfield
cfe308a177
Improve sq key revoke's --help. 2024-06-13 10:46:58 +02:00
Neal H. Walfield
18840201ed
Add examples for sq key revoke. 2024-06-13 10:25:15 +02:00
Neal H. Walfield
8948a66df7
Improve sq key password's --help. 2024-06-13 10:25:15 +02:00
Neal H. Walfield
d42da17949
Port sq key password's examples to the example framework.
- Port `sq key password`'s examples to the example framework and
    improve the examples.

  - See #196.
2024-06-13 10:25:00 +02:00
Neal H. Walfield
e7640521f5
Improve sq key delete's --help. 2024-06-13 09:38:10 +02:00
Neal H. Walfield
5be75a83ff
Add examples for sq key delete. 2024-06-13 09:35:43 +02:00
Neal H. Walfield
8587dd05cd
Improve sq key export's --help. 2024-06-12 18:12:38 +02:00
Neal H. Walfield
c056d41319
Improve sq key import's --help. 2024-06-12 18:12:38 +02:00
Neal H. Walfield
6f8b9074b1
When failing to get a revocation signer, show the actual error.
- When we fail to get a signer for `sq key revoke`, `sq key subkey
    revoke`, or `sq key userid revoke` we don't print out the actual
    error.  This can be confusing.

  - Print the actual error.

  - See #250.
2024-06-12 18:09:15 +02:00
Neal H. Walfield
0e5c58ef05
Use the null policy when creating revocation certificates.
- When creating a revocation certificate using, e.g., `sq key
    revoke`, use the null policy.

  - Even if a certificate is not valid according to the standard
    policy, it can still be useful to revoke it.

  - Fixes #250.
2024-06-12 18:02:22 +02:00
Neal H. Walfield
fa835e234f
Port the sq key revoke tests to the common test framework.
- Add `Sq::key_revoke`, and change the `sq key revoke` integration
    tests to use it.
2024-06-12 16:50:56 +02:00
Neal H. Walfield
1817c305ae
Make helper function more generic.
- Change `compare_notations` from taking a slice containing two
    elements to taking a slice taking any number of elements.
2024-06-12 16:49:26 +02:00
Neal H. Walfield
9f09e34e36
Loosen constraints on the key used to issue a revocation.
- Before using a key, we check it for validity including whether it
    is revoked, and whether it is live.

  - Don't enforce these constraints when using a key to issue a
    revocation: it may be important to issue a revocation even if the
    key is no longer valid.
2024-06-12 16:49:26 +02:00
Neal H. Walfield
7228049640
When an example is too wide, indicate how wide it is.
- We check that examples are not too wide.  When an example is too
    wide, indicate how wide the line is.
2024-06-12 16:49:16 +02:00
Neal H. Walfield
6f452d51c6
Rename UseridRevocationReason to UserIDReasonForRevocation.
- Rename `UseridRevocationReason` to `UserIDReasonForRevocation`,
    which is more consistent with other identifiers.
2024-06-12 16:47:50 +02:00
Neal H. Walfield
8ae03f1945
Rename RevocationReason to KeyReasonForRevocation.
- Rename `RevocationReason` to `KeyReasonForRevocation`.
    `RevocationReason` sounds generic, but there is also
    `UseridRevocationReason`.

  - This name aligns better with the type from `sequoia-openpgp` that
    it wraps, `ReasonForRevocation`.
2024-06-12 16:46:55 +02:00
Neal H. Walfield
bc5c0cf9f1
Rename the --expiry argument to --expiration.
- Rename the `--expiry` argument to `--expiration`, and adjust the
    name of the corresponding fields, and data structures.

  - Expiration and expiry have about the same meaning.  According to
    my research, "expiration" is used in American English whereas
    both are used in British English.

  - This change aligns the usage with RFC 4880's terminology, which
    uses the word "expiration" many times, but never uses "expiry".
2024-06-11 22:51:40 +02:00
Neal H. Walfield
fa773b0e78
Improve Expiry's Debug implementation.
- Improve `Expiry`'s Debug implementation: use a bigger unit when
    possible.
2024-06-11 12:15:41 +02:00
Neal H. Walfield
8463e8c5e5
Improve sq key generate's --help output. 2024-06-11 12:15:35 +02:00
Neal H. Walfield
c3582bea01
Port sq key generate's examples to the example framework.
- Port `sq key generate`'s examples to the example framework, and
    improve the examples.
2024-06-11 10:27:47 +02:00
Neal H. Walfield
d76e1ae4db
Change sq key attest-certifications to support the key store and cert store.
- Change `sq key attest-certifications` to use the key store and the
    cert store.

  - See #205.
2024-06-10 23:24:33 +02:00
Neal H. Walfield
353c21554a
Don't have sq key attest-certifications' --all be the default.
- In `sq key attest-certifications`, don't make `--all` the
    default, but require the user to specify it explicitly.

  - This makes it easier to introduce more fine-grained selectors in
    the future.

  - See #262.
2024-06-10 23:24:33 +02:00
Neal H. Walfield
6dcfb270ad
Make sq key attest-certifications' positional parameter a named parameter.
- In `sq key attest-certifications`, change the certificate file
     parameter from a positional parameter to a named parameter,
     `--cert-file`.
2024-06-10 23:24:33 +02:00
Neal H. Walfield
90bad2927a
Add test for sq key attest-certifications. 2024-06-10 23:24:33 +02:00
Neal H. Walfield
f1a99b10d9
Change sq key adopt to support the cert store.
- Change `sq key adopt` to use the cert store.

  - See #205.
2024-06-10 23:24:33 +02:00
Neal H. Walfield
a08b536225
Add a convenience function to import a certificate.
- Add `Sq::import_cert`, which is a convenience function that
    imports a certificate into the cert store.
2024-06-10 23:24:32 +02:00
Neal H. Walfield
f3037392f6
Change sq key adopt to support the key store.
- Change `sq key adopt` to use the key store.

  - See #205.
2024-06-10 23:24:32 +02:00
Neal H. Walfield
54ae8eda30
Add functions to lookup a certificate with an alternate policy.
- Add `Sq::lookup_with_policy` and `Sq::lookup_one_with_policy` to
    lookup a certificate using an alternate policy.
2024-06-10 23:24:32 +02:00
Neal H. Walfield
47e076d890
If secret key material is passed via --keyring, use it.
- If the user supplies a keyring using `--keyring`, and it contains
    the secret key material that we are looking for, use it.
2024-06-10 23:24:32 +02:00