SQ(1)

NAME
sq - A command-line frontend for Sequoia, an implementation of OpenPGP

SYNOPSIS
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]

DESCRIPTION
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.

OPTIONS

  Global options

--batch
    Prevents any kind of prompting

    Enables batch mode. In batch mode, sq will never ask for user input, such as prompting for passwords.

--cert-store=PATH
    Specify the location of the certificate store

    By default, `sq` uses the OpenPGP certificate directory in Sequoia's home directory (see `--home`), $HOME/.local/share/pgp.cert.d. This can be overridden by setting the `PGP_CERT_D` environment variable.

    Use 'default' to explicitly use the default cert store, use 'none' to not use a cert store.

--cli-version=CLI_VERSION
    Select a CLI version

    `sq`'s CLI is versioned using a semantic versioning scheme. Setting this options causes `sq` to error out if it does not implement an interface that is compatible with the specified version. For instance, if you set this to 1.1.0 and `sq` only implements version 1.0.0 of the interface, then `sq` will error out.

    `sq` may implement multiple interfaces (e.g., 1.1.4, and 2.0.5). By default, it selects the newest version. As such, if you require a particular interface, you need to set this option for every call to `sq`.

    This option must be the first option on the command line.

    This version of `sq` implements version 1.3.1 of the CLI interface.

    Stable since 1.2.0.

-h, --help
    Print help (see a summary with '-h')

--home=PATH
    Set the home directory

    Sequoia's default home directory is `$HOME`. When using the default location, files are placed according to the local standard, e.g., the XDG Base Directory Specification. When an alternate location is specified, the user data, configuration files, and cache data are placed under a single, unified directory. This is a lightweight way to partially isolate `sq`.

    Use 'default' to explicitly use the default location, use 'none' to not use a home directory.

--key-store=PATH
    Override the key store server and its data

    A key store server manages and protects secret key material. By default, `sq` connects to the key store server for Sequoia's default home directory (see `--home`), $HOME/.local/share/sequoia/keystore. If no key store server is running, one is started.

    This option causes `sq` to use an alternate key store server. If necessary, a key store server is started, and configured to look for its data in the specified location.

    Use 'default' to explicitly use the default server, use 'none' to not use a key store.

--keyring=PATH
    Specify the location of a keyring to use

    Keyrings are used in addition to any certificate store. The content of the keyring is not imported into the certificate store. When a certificate is looked up, it is looked up in all keyrings and any certificate store, and the results are merged together.

--known-notation=NOTATION
    Add NOTATION to the list of known notations

    This is used when validating signatures. Signatures that have unknown notations with the critical bit set are considered invalid.

--overwrite
    Overwrite existing files

--password-file=FILE
    Seed the password cache with the specified password

    The password is added to the password cache. When decrypting secret key material, the password cache is only used if the key is not protected by a retry counter, which automatically locks the key if a wrong password is entered too many times.

    Note that the entire key file will be used as the password, including any surrounding whitespace like a trailing newline.

--policy-as-of=TIME
    Select the cryptographic policy as of the specified time

    The time is expressed as an ISO 8601 formatted timestamp. The policy determines what cryptographic constructs are allowed.

    If you are working with a message that sq rejects, because it is protected by cryptographic constructs that are now considered broken, you can use this option to select a different cryptographic policy. If you are relying on the cryptography, e.g., you are verifying a signature, then you should only do this if you are confident that the message hasn't been tampered with.

    TIME is interpreted as an ISO 8601 timestamp. To set the policy time to January 1, 2007 at midnight UTC, you can do:

    $ sq --policy-as-of 20070101 verify --message msg.pgp

    Defaults to the reference time, which can be set using --time.

-q, --quiet
    Be more quiet

    The default can be changed in the configuration file using the setting `ui.quiet`.

--time=TIME
    Set the reference time as an ISO 8601 formatted timestamp

    Normally, commands use the current time as the reference time. This argument allows the user to use a difference reference time. For instance, when creating a key using `sq key generate`, the creation time is normally set to the current time, but can be overridden using this option. Similarly, when verifying a message, the message is verified with respect to the current time. This option allows the user to use a different time.

    TIME is interpreted as an ISO 8601 timestamp. To set the certification time to July 21, 2013 at midnight UTC, you can do:

    $ sq --time 20130721 verify --message msg.pgp

    To include a time, say 5:50 AM, add a T, the time and optionally the timezone (the default timezone is UTC):

    $ sq --time 20130721T0550+0200 --message verify msg.pgp

--trust-root=FINGERPRINT|KEYID
    Consider the specified certificate to be a trust root

    Trust roots are used by trust models, e.g., the Web of Trust, to authenticate certificates and User IDs.

-v, --verbose
    Be more verbose

    The default can be changed in the configuration file using the setting `ui.verbose`.

SUBCOMMANDS

  sq encrypt
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.

  sq decrypt
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`.

  sq sign
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.

  sq verify
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.

  sq download
Download and authenticate 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.

  sq inspect
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.

  sq cert
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.

  sq key
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.

  sq pki
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.

  sq network
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.

  sq keyring
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.

  sq packet
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.

  sq config
Query, inspect, and create the configuration file.

This subcommand can be used to query and inspect the configuration file (default location: $HOME/.config/sequoia/sq/config.toml), and to create a template that can be edited to your liking.

Configuration file: $HOME/.config/sequoia/sq/config.toml

  sq version
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.

ENVIRONMENT

SEQUOIA_CERT_STORE=PATH
    Specify the location of the certificate store

    By default, `sq` uses the OpenPGP certificate directory in Sequoia's home directory (see `--home`), $HOME/.local/share/pgp.cert.d. This can be overridden by setting the `PGP_CERT_D` environment variable.

    Use 'default' to explicitly use the default cert store, use 'none' to not use a cert store.

SEQUOIA_HOME=PATH
    Set the home directory

    Sequoia's default home directory is `$HOME`. When using the default location, files are placed according to the local standard, e.g., the XDG Base Directory Specification. When an alternate location is specified, the user data, configuration files, and cache data are placed under a single, unified directory. This is a lightweight way to partially isolate `sq`.

    Use 'default' to explicitly use the default location, use 'none' to not use a home directory.

SEQUOIA_KEY_STORE=PATH
    Override the key store server and its data

    A key store server manages and protects secret key material. By default, `sq` connects to the key store server for Sequoia's default home directory (see `--home`), $HOME/.local/share/sequoia/keystore. If no key store server is running, one is started.

    This option causes `sq` to use an alternate key store server. If necessary, a key store server is started, and configured to look for its data in the specified location.

    Use 'default' to explicitly use the default server, use 'none' to not use a key store.

EXAMPLES

  sq encrypt

Encrypt a file for a recipient given by fingerprint.

    sq encrypt --for=EB28F26E2739A4870ECC47726F0073F60FD0CBF0 \
        --signer-email=juliet@example.org document.txt

Encrypt a file for a recipient given by email.

    sq encrypt --for-email=alice@example.org \
        --signer-email=juliet@example.org document.txt

  sq decrypt

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

  sq sign

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.sig document.txt

  sq verify

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

  sq download

Download and verify the Debian 12 checksum file.

    sq download --url=file://debian/SHA512SUMS \
        --signature-url=file://debian/SHA512SUMS.sign \
        --signer=DF9B9C49EAA9298432589D76DA87E80D6294BE9B \
        --output=SHA512SUMS

  sq inspect

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

SEE ALSO
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/>.

VERSION
1.3.1