SQ(1) | User Commands | SQ(1) |
sq - A command-line frontend for Sequoia, an implementation of OpenPGP
sq encrypt [OPTIONS] FILE
sq decrypt [OPTIONS] FILE
sq sign [OPTIONS] FILE
sq verify [OPTIONS] FILE
sq download [OPTIONS]
sq inspect [OPTIONS] FILE
sq cert [OPTIONS] SUBCOMMAND
sq key [OPTIONS] SUBCOMMAND
sq pki [OPTIONS] SUBCOMMAND
sq network [OPTIONS] SUBCOMMAND
sq keyring [OPTIONS] SUBCOMMAND
sq packet [OPTIONS] SUBCOMMAND
sq config [OPTIONS] SUBCOMMAND
sq version [OPTIONS]
A command-line frontend for Sequoia, an implementation of OpenPGP.
Functionality is grouped and available using subcommands. This interface is not completely stateless. In particular, the user's default certificate store is used. This can be disabled using `--cert-store=none`. Similarly, a key store is used to manage and protect secret key material. This can be disabled using `--key-store=none`.
OpenPGP data can be provided in binary or ASCII armored form. This will be handled automatically. Emitted OpenPGP data is ASCII armored by default.
We use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. Conversely, we use the term "key" to refer to OpenPGP keys that do contain secrets.
Encrypt a message.
Encrypt a message for any number of recipients and with any number of passwords, optionally signing the message in the process.
The converse operation is `sq decrypt`.
`sq encrypt` respects the reference time set by the top-level `--time` argument. It uses the reference time when selecting encryption keys, and it sets the signature's creation time to the reference time.
Decrypt a message.
Decrypt a message using either supplied keys, or by prompting for a password. If message tampering is detected, an error is returned. See below for details.
If certificates are supplied using the `--signer-file` option, any signatures that are found are checked using these certificates. Verification is only successful if there is no bad signature, and the number of successfully verified signatures reaches the threshold configured with the `--signatures` parameter.
If the signature verification fails, or if message tampering is detected, the program terminates with an exit status indicating failure. and the output file is deleted. If the output was sent to stdout, then the last 25 MiB of the message are withheld (consequently, if the message is smaller than 25 MiB, no output is produced).
The converse operation is `sq encrypt`.
Sign messages or data files.
Creates signed messages or detached signatures. Detached signatures are often used to sign software packages.
The converse operation is `sq verify`.
`sq sign` respects the reference time set by the top-level `--time` argument. When set, it uses the specified time instead of the current time, when determining what keys are valid, and it sets the signature's creation time to the reference time instead of the current time.
Verify signed messages or detached signatures.
When verifying signed messages, the message is written to stdout or the file given to `--output`.
When a detached message is verified, no output is produced. Detached signatures are often used to sign software packages.
Verification is only successful if there is no bad signature, and the number of successfully verified signatures reaches the threshold configured with the `--signatures` parameter. If the verification fails, the program terminates with an exit status indicating failure, and the output file is deleted. If the output was sent to stdout, then the last 25 MiB of the message are withheld (consequently, if the message is smaller than 25 MiB, no output is produced).
A signature is considered to have been authenticated if the signer can be authenticated. If the signer is provided via `--signer-file`, then the signer is considered authenticated. Otherwise, the signer is looked up and authenticated using the Web of Trust. If at least one User ID can be fully authenticated, then the signature is considered to have been authenticated. If the signature includes a Signer User ID subpacket, then only that User ID is considered. Note: the User ID need not be self signed.
The converse operation is `sq sign`.
If you are looking for a standalone program to verify detached signatures, consider using sequoia-sqv.
`sq verify` respects the reference time set by the top-level `--time` argument. When set, it verifies the message as of the reference time instead of the current time.
Download and authenticates the data.
This command downloads the data from the specified URL, checks the signature, and then authenticates the signer. If the signer cannot be authenticated, the data is deleted, if possible.
Inspect data, like file(1).
It is often difficult to tell from cursory inspection using cat(1) or file(1) what kind of OpenPGP one is looking at. This subcommand inspects the data and provides a meaningful human-readable description of it.
`sq inspect` respects the reference time set by the top-level `--time` argument. It uses the reference time when determining what binding signatures are active.
Manage certificates.
We use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. This subcommand provides primitives to generate and otherwise manipulate certs.
Conversely, we use the term "key" to refer to OpenPGP keys that do contain secrets. See `sq key` for operations on keys.
Manage keys.
We use the term "key" to refer to OpenPGP keys that do contain secrets. This subcommand provides primitives to generate and otherwise manipulate keys.
Conversely, we use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. See `sq cert` for operations on certificates.
Authenticate certs using the Web of Trust.
The "Web of Trust" is a decentralized trust model popularized by PGP. It is a superset of X.509, which is a hierarchical trust model, and is the most popular trust model on the public internet today. As used on the public internet, however, X.509 relies on a handful of global certification authorities (CAs) who often undermine its security.
The Web of Trust is more nuanced than X.509. Using the Web of Trust, require multiple, independent paths to authenticate a binding by only partially trusting CAs. This prevents a single bad actor from compromising their security. And those who have stronger security requirements can use the Web of Trust in a completely decentralized manner where only the individuals they select – who are not necessarily institutions – act as trusted introducers.
Retrieve and publish certificates over the network.
OpenPGP certificates can be discovered and updated from, and published on services accessible over the network. This is a collection of commands to interact with these services.
Manage collections of keys or certs.
Collections of keys or certificates (also known as "keyrings" when they contain secret key material, and "certrings" when they don't) are any number of concatenated certificates. This subcommand provides tools to list, split, merge, and filter keyrings.
Note: In the documentation of this subcommand, we sometimes use the terms keys and certs interchangeably.
Low-level packet manipulation.
An OpenPGP data stream consists of packets. These tools allow working with packet streams. They are mostly of interest to developers, but `sq packet dump` may be helpful to a wider audience both to provide valuable information in bug reports to OpenPGP-related software, and as a learning tool.
Get configuration options.
This subcommand can be used to inspect the configuration file (default location: $HOME/.config/sequoia/sq/config.toml), and to create a template that can be edited to your liking.
Detailed version and output version information.
With no further options, this command lists the version of `sq`, the version of the underlying OpenPGP implementation `sequoia-openpgp`, and which cryptographic library is used.
Encrypt a file for a recipient given by fingerprint.
sq encrypt --for EB28F26E2739A4870ECC47726F0073F60FD0CBF0 \
document.txt
Encrypt a file for a recipient given by email.
sq encrypt --for-email alice@example.org document.txt
Decrypt a file using a secret key
sq decrypt --recipient-file juliet-secret.pgp ciphertext.pgp
Decrypt a file verifying signatures
sq decrypt --recipient-file juliet-secret.pgp --signer-file \
romeo.pgp ciphertext.pgp
Decrypt a file using the key store
sq decrypt ciphertext.pgp
Create a signed message.
sq sign --signer-file juliet-secret.pgp --message document.txt
Create a detached signature.
sq sign --signer-file juliet-secret.pgp --signature-file \
document.txt
Create a signature with the specified creation time.
sq sign --signer-file juliet-secret.pgp --time 2024-02-29 \
--signature-file document.txt
Verify a signed message.
sq verify --message document.pgp
Verify a detached signature.
sq verify --signature-file=document.sig document.txt
Verify a message as of June 19, 2024 at midnight UTC.
sq verify --time 2024-06-19 --message document.pgp
Download and verify the Debian 12 checksum file.
sq download --url=file://debian/SHA512SUMS \
--signature=file://debian/SHA512SUMS.sign \
--signer=DF9B9C49EAA9298432589D76DA87E80D6294BE9B \
--output=SHA512SUMS
Inspect a certificate.
sq inspect juliet.pgp
Show how the certificate looked on July 21, 2013.
sq inspect --time 20130721 juliet.pgp
Inspect an encrypted message.
sq inspect message.pgp
Inspect a detached signature.
sq inspect document.sig
sq-encrypt(1), sq-decrypt(1), sq-sign(1), sq-verify(1), sq-download(1), sq-inspect(1), sq-cert(1), sq-key(1), sq-pki(1), sq-network(1), sq-keyring(1), sq-packet(1), sq-config(1), sq-version(1).
For the full documentation see <https://book.sequoia-pgp.org>.
0.40.0 (sequoia-openpgp 1.21.2)
0.40.0 | Sequoia PGP |