Commit Graph

544 Commits

Author SHA1 Message Date
Neal H. Walfield
bd235e7f67
Move the key expiration functionality to common::expire.
- Move the expiration logic from `commands:🔑:expire` to
    `commands:common::expire`.

  - Change `commands:🔑:expire` to use it.
2024-06-04 23:24:21 +02:00
Neal H. Walfield
fb5227f8e3
Update NEWS. 2024-05-30 20:26:33 +02:00
Neal H. Walfield
779eaecabd
Fix sq key subkey add to save the new subkey to the key store.
- When saving the new subkey, `sq key subkey add` accidentally only
    saved the public key.

  - Also save the secret key.
2024-05-30 20:26:32 +02:00
Neal H. Walfield
7866b2f5bb
Change sq key subkey add to support the cert store and key store.
- See #205.
2024-05-29 16:03:06 +02:00
Neal H. Walfield
fb16a29f00
Make sq key subkey add's positional parameter a named parameter.
- In `sq key subkey add`, change the certificate file parameter from a
    positional parameter to a named parameter, `--cert-file`.
2024-05-29 14:00:30 +02:00
Neal H. Walfield
42cca6b172
When reading from a file, default to writing to stdout.
- Change `sq key revoke`, `sq key userid revoke`, and `sq key subkey
    revoke` to default to writing to stdout when reading from a file.
2024-05-29 09:41:58 +02:00
Neal H. Walfield
3debf8b584
Modify the sq key revoke tests to test the cert store integration.
- Modify the `sq key revoke` tests to also test the cert store and
    key store integration.

  - Somehow this wasn't added to
    cca564356c.
2024-05-28 15:04:48 +02:00
Neal H. Walfield
ab0e2a446c
Change sq cert lint to support the cert store and key store.
- See #205.
2024-05-28 14:33:27 +02:00
Neal H. Walfield
5c1cf92f9b
Make sq cert lint's position parameter a named parameter.
- In `sq cert lint`, change the certificate file parameter from a
    position parameter to a named parameter, `--cert-file`.
2024-05-28 14:24:58 +02:00
Neal H. Walfield
54bf3e977b
Add Sq::get_signer.
- Add a convenience function to `Sq`, `get_signer`, to get a signer
    for a given key.

  - Change `Sq::get_keys` to use it.
2024-05-28 14:03:52 +02:00
Neal H. Walfield
f4fe306093
Use the configured home directory to find the keystore.
- Respect `--home` when locating the keystore.

  - Fixes e75ad72c65.
2024-05-28 13:46:22 +02:00
Neal H. Walfield
22cc90e11f
Change sq cert lint to not read from stdin by default.
- Reading from stdin by default has caused confusion.  If the user
    wants to read from stdin, then they should explicitly opt-in.
2024-05-28 09:22:19 +02:00
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