sq-key-generate - Man Page
Generates a new key
Synopsis
sq key generate [Options]
Description
Generates a new key.
Generating a key is the prerequisite to receiving encrypted messages and creating signatures. There are a few parameters to this process, but we provide reasonable defaults for most users.
When generating a key, we also generate a revocation certificate. This can be used in case the key is superseded, lost, or compromised. It is a good idea to keep a copy of this in a safe place.
After generating a key, use `sq key extract-cert` to get the certificate corresponding to the key. The key must be kept secure, while the certificate should be handed out to correspondents, e.g. by uploading it to a key server.
By default a key expires after 3 years. Using the `--expiry=` argument specific validity periods may be defined. It allows for providing a point in time for validity to end or a validity duration.
`sq key generate` respects the reference time set by the top-level `--time` argument. It sets the creation time of the key, any subkeys, and the binding signatures to the reference time.
Options
Subcommand options
- -c, --cipher-suite=CIPHER-SUITE
Selects the cryptographic algorithms for the key
- --can-authenticate
Adds an authentication-capable subkey (default)
- --can-encrypt=PURPOSE
Adds an encryption-capable subkey. Encryption-capable subkeys can be marked as suitable for transport encryption, storage encryption, or both, i.e., universal. [default: universal]
- --can-sign
Adds a signing-capable subkey (default)
- --cannot-authenticate
Adds no authentication-capable subkey
- --cannot-encrypt
Adds no encryption-capable subkey
- --cannot-sign
Adds no signing-capable subkey
- --expiry=EXPIRY
Defines EXPIRY for the key as ISO 8601 formatted string or custom duration. If an ISO 8601 formatted string is provided, the validity period reaches from the reference time (may be set using `--time`) to the provided time. Custom durations starting from the reference time may be set using `N[ymwds]`, for N years, months, weeks, days, or seconds. The special keyword `never` sets an unlimited expiry.
- -o, --output=FILE
Writes to FILE or stdout if omitted
- --rev-cert=FILE or -
Writes the revocation certificate to FILE. mandatory if OUTFILE is `-`. [default: <OUTFILE>.rev]
- -u, --userid=EMAIL
Adds a userid to the key
- --with-password
Protects the key with a password
Global options
See sq(1) for a description of the global options.
Examples
First, generate a key
sq key generate --userid '<juliet@example.org>' \ --output juliet.key.pgp
Then, extract the certificate for distribution
sq key extract-cert --output juliet.cert.pgp juliet.key.pgp
Generate a key protecting it with a password
sq key generate --userid '<juliet@example.org>' --with-password
Generate a key with multiple userids
sq key generate --userid '<juliet@example.org>' \ --userid 'Juliet Capulet'
Generate a key whose creation time is June 9, 2011 at midnight UTC
sq key generate --time 20110609 --userid Noam \ --output noam.pgp
See Also
For the full documentation see <https://book.sequoia-pgp.org>.
Version
0.34.0 (sequoia-openpgp 1.19.0)