Commit Graph

632 Commits

Author SHA1 Message Date
Neal H. Walfield
5f8ef02cd4
Require specifying --userid with sq key userid revoke.
- Change the user ID argument from a position argument in `sq key
    userid revoke` to an argument specified with `--userid`.
2024-05-27 19:14:52 +02:00
Neal H. Walfield
cca564356c
Change sq key revoke etc. to support the cert store and key store.
- Change `sq key revoke`, `sq key subkey revoke`, and `sq key userid
    revoke` to support the cert store and key store.

  - Add `--cert` to specify a certificate by key ID or fingerprint.

  - If `--output` is not specified and `--cert` is, import the
    modified certificate into the cert store.  If `--output` is not
    specified and `--cert-file` is, write the modified certificate to
    stdout.
2024-05-27 19:14:47 +02:00
Neal H. Walfield
e8dc0fd9a3
Change --cert-file and --revoker-file to also accept -.
- Change the `--cert-file` and `--revoker-file` arguments to `sq key
    revoked`, `sq key userid revoke`, and `sq key subkey revoke` to
    interpret `-` as meaning reading from stdin.
2024-05-27 19:13:57 +02:00
Neal H. Walfield
e24c9ff92e
Rename --certificate-file and --revocation-file.
- `sq key revoked`, `sq key userid revoke`, and `sq key subkey
    revoke` have two arguments for naming a certificate:
    `--certificate-file` and `--cert-file`.  The latter is an alias.
    Drop `--certificate-file` and promote `--cert-file`.  This
    harmonizes these subcommands with other subcommands, which only
    use `--cert-file`.

  - Rename `--revocation-file` to `--revoker-file`, as the file
    contains a "revoker" not a "revocation."
2024-05-27 19:12:46 +02:00
Neal H. Walfield
368e3f0902
Refactor RevocationOutput to dry out the code.
- The implementations of `RevocationOutput::write` are nearly
    identical.

  - Refactor `RevocationOutput` to provide a default implementation of
    the `write` method.
2024-05-27 13:54:05 +02:00
Neal H. Walfield
e22cb7517a
Inline read_secret.
- `read_secret` is intended to be a convenience function, but it
    doesn't save much code.  Remove it.
2024-05-27 13:54:05 +02:00
Neal H. Walfield
084daa90b8
Inline read_cert.
- `read_cert` is intended to be a convenience function, but it only
    saves one line of code.  Remove it.
2024-05-27 13:54:04 +02:00
Neal H. Walfield
f5afde869b
Use the primary key to create revocation certificates.
- A certification-capable key is for creating certifications.

  - Use the primary key to create a revocation certificate.
2024-05-27 13:54:04 +02:00
Neal H. Walfield
bbe350118a
Change sq key userid add to support the cert store and key store.
- Change `sq key userid add` to support the cert store and key
    store.

  - Add `--cert` to specify a certificate by key ID or fingerprint.

  - Change the positional file argument to `--cert-file`.

  - Change the positional user ID to `--userid`.

  - If `--output` is not specified and `--cert` is, import the
    modified certificate into the cert store.  If `--output` is not
    specified and `--cert-file` is, write the modified certificate to
    stdout
2024-05-27 13:54:02 +02:00
Neal H. Walfield
42126b5534
Convert sq decrypt examples to use the example framework.
- See #196.
2024-05-27 13:36:35 +02:00
Neal H. Walfield
41d23cc5b9
Fix help message.
- `FileOrStdin::HELP_REQUIRED` and `FileOrStdin::HELP_OPTIONAL` were
    reversed.

  - Fix them.
2024-05-27 13:36:35 +02:00
Neal H. Walfield
2a7045b70b
Improve the documentation for Sq::get_keys et al.
- Improve the documentation for `Sq::get_keys`,
    `Sq::get_primary_keys`, `Sq::get_primary_key`,
    `Sq::get_signing_keys`, `Sq::get_signing_key`,
    `Sq::get_certification_keys`, and `Sq::get_certification_key`.
2024-05-27 13:36:35 +02:00
Neal H. Walfield
538e3ef81e
Add Sq::get_certification_key.
- Add `Sq::get_certification_key`, which is a wrapper around
    `Sq::get_certification_keys`, for the case where only one
    certificate is looked up.

  - Update users.
2024-05-27 13:36:35 +02:00
Neal H. Walfield
dd2751c1c3
Add Sq::get_signing_key.
- Add `Sq::get_signing_key`, which is a wrapper around
    `Sq::get_signing_keys`, for the case where only one certificate is
    looked up.
2024-05-27 13:36:34 +02:00
Neal H. Walfield
ce3e849828
Add Sq::get_primary_key.
- Add `Sq::get_primary_key`, which is a wrapper around
    `Sq::get_primary_keys`, for the case where only one certificate is
    looked up.

  - Update users.
2024-05-27 13:36:34 +02:00
Neal H. Walfield
648b9ff2c3
Change get_keys et al. to be methods on Sq.
- Make the functions `get_keys`, `get_primary_keys`,
    `get_signing_keys` and `get_certification_keys` methods on `Sq`.

  - Move the associated types, `GetKeysOptions`, and `KeyType`, to the
    `sq` module.
2024-05-27 13:36:34 +02:00
Neal H. Walfield
4ae7f6f597
Record whether --time was set.
- Add a field to `Sq`, `time_is_now`.

  - Set it according to whether `--time` was set.
2024-05-27 13:36:34 +02:00
Neal H. Walfield
0da271c498
Remove PKS support. 2024-05-27 13:36:07 +02:00
Neal H. Walfield
add78cbdd4
Change best_effort_primary_uid{,_for} to methods on Sq.
- Move `best_effort_primary_uid` into `Sq` as `Sq::best_userid`, and
    `best_effort_primary_uid_for` into `Sq` as `Sq::best_userid_for`.
2024-05-26 14:14:53 +02:00
Neal H. Walfield
a2cf7e2b0d
Don't copy time into the signing functions, use sq.
- Change `sign`, `sign_data`, `sign_message`, `sign_message_` and
    `clearsign` to not have their own `time` parameters, but to use `Sq`
    for their configuration.
2024-05-26 14:13:51 +02:00
Neal H. Walfield
e9d2ea77e2
Don't copy policy and time into UserIDRevocation, use sq.
- Change `UserIDRevocation` to not have its own `policy` and
    `time` fields, but to use `Sq` for its configuration.
2024-05-26 12:25:28 +02:00
Neal H. Walfield
4920141e60
Don't copy policy and time into SubkeyRevocation, use sq.
- Change `SubkeyRevocation` to not have its own `policy` and
    `time` fields, but to use `Sq` for its configuration.
2024-05-26 12:23:19 +02:00
Neal H. Walfield
9b3180705e
Don't copy policy and time into CertificateRevocation, use sq.
- Change `CertificateRevocation` to not have its own `policy` and
    `time` fields, but to use `Sq` for its configuration.
2024-05-26 12:16:52 +02:00
Neal H. Walfield
5afdb049ff
Rename Config to Sq. 2024-05-26 09:57:51 +02:00
Neal H. Walfield
446c63d0ed
Move Config to its own module.
- Move the `Config` to sq.rs.

  - Change `main.rs` to `sq`'s entry point.
2024-05-26 09:40:23 +02:00
Neal H. Walfield
94b506ca37
Release v0.36.0. 2024-05-21 23:33:00 +02:00
Neal H. Walfield
11203237e3
Update Cargo.lock. 2024-05-21 23:31:10 +02:00
Neal H. Walfield
7fc7ccac38
Revise the sq key generate documentation.
- Revise the `sq key generate` documentation to emphasize the key
    store.
2024-05-21 23:15:31 +02:00
Neal H. Walfield
58d3753cba
Save revocation certificates to the user's home directory.
- When generating a new key, and saving that key to the key store,
    don't require that the user think about where the revocation
    certificate should be saved; just save it in the Sequoia home
    directory.
2024-05-21 22:57:21 +02:00
Neal H. Walfield
006482b352
Implement sq key export. 2024-05-21 21:22:44 +02:00
Neal H. Walfield
e75ad72c65
Use sequoia-directories.
- Use `sequoia-directories` to compute the home directory, and the
    various component directories.

  - This also allows the use of `SEQUOIA_HOME` to set the home
    directory.
2024-05-21 21:22:39 +02:00
Neal H. Walfield
1d162d214b
Upgrade sequoia-keystore. 2024-05-21 18:11:44 +02:00
Neal H. Walfield
81009e984d
Upgrade pest.
- Version 2.7.9 was yanked.  Update to 2.7.10.
2024-05-21 18:11:44 +02:00
Devan Carpenter
2f97c2ab9e
ci: use sequoia-pipeline component 2024-04-22 13:29:10 -04:00
Daiki Ueno
9483554e61
Replace "sq link" mentions with "sq pki link"
- While the commit b5a7d15710 moved the
   "sq link" command under "sq pki", there are some left-overs in the
   error messages.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-04-19 17:22:04 +02:00
Neal H. Walfield
9be9f83e72
sq pki list should work with subkey key IDs and fingerprints.
- Change `sq pki list`, etc. to work with subkey key IDs and
    fingerprints.

  - Consider: a user examines a signature using `sq inspect,, and then
    looks up the signer's key ID.  We shouldn't say that the
    certificate is not found, but allow naming the certificate by the
    subkey's key ID.

  - Fixes #246.
2024-04-16 10:17:10 +02:00
Neal H. Walfield
3e964085cd
Don't show binding-related guidance when no bindings are shown.
- `sq pki list` provides guidance on how to use bindings.  Don't
    show that guidance if no bindings are shown.

  - Fixes #245.
2024-04-16 10:15:16 +02:00
Neal H. Walfield
066340edc0
When sq inspect displays an issuer, also show a label.
- When `sq inspect` shows an `Alleged signer` or an `Alleged
    certifier`, it only shows the signing key's key ID.  Use
    `best_effort_primary_uid_for` to also display a label.

  - Fixes #242.
2024-04-16 08:44:26 +02:00
Neal H. Walfield
c48d1d48dc
Release 0.35.0. 2024-04-15 15:27:08 +02:00
Neal H. Walfield
645c3cb914
Update Cargo.lock. 2024-04-15 15:27:08 +02:00
Neal H. Walfield
aafce5da3f
Upgrade sequoia-cert-store.
- Upgrade `sequoia-cert-store` to at least 0.5.3.  0.5.1 and 0.5.2
    have a minor bug in the cert-d lookup code.
2024-04-15 15:26:58 +02:00
Justus Winter
96bd1956b4
man: Emit default values. 2024-04-15 13:49:19 +02:00
Justus Winter
8a44cc4706
man: Emit possible values. 2024-04-15 13:33:16 +02:00
Justus Winter
3e138d4c59
man: Support optional arguments to command line options. 2024-04-15 13:33:16 +02:00
Neal H. Walfield
a8f01ef1ae
Make the output of sq pki list, etc. more concise by default.
- The output of `sq pki list`, `sq pki authenticate`, `sq pki
    identify` and `sq pki lookup` are overwhelming.

  - Change the output to only show whether a binding can be
    authenticated, not the paths; group the user IDs according
    to the certificate; and, show whether the components are expired
    or revoked.

  - Use the old output format if the user passes `--show-paths`.

  - Fixes #240.
2024-04-12 18:55:34 +02:00
Neal H. Walfield
c453b401cf
When prompting for a password, show the user ID, if known.
- When `sq decrypt` prompts for a password to decrypt the PKESK,
    don't just show the recipient's key ID, also show the
    certificate's user ID, if that is available.
2024-04-12 15:56:35 +02:00
Neal H. Walfield
f0eaf78997
If decryption fails, show the message's recipients.
- If decrypting a message fails, show the message's recipients.
    This may help the user debug the problem, e.g., it is not
    encrypted to them, or they need to import a key.

  - Fixes #231.
2024-04-12 15:52:07 +02:00
Neal H. Walfield
e9b502a258
When wrapping lines of text, limit the maximum width.
- Limit the maximum width of text columns to improve readability.

  - Fixes #239.
2024-04-12 14:59:03 +02:00
Neal H. Walfield
9cefdf6b6a
Improve formatting.
- The formatting of `sq verify`'s guidance was poor.  In particular,
    the indentation was wrong when the lines wrapped.

  - Improve the formatting.
2024-04-12 14:54:38 +02:00
Neal H. Walfield
920bc83953
Show guidance when signature verifications.
- If signature verification fails because, a certificate is missing
    suggest that the user use `sq network fetch`.
2024-04-12 14:44:37 +02:00