sq - Man Page

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 inspect [Options] FILE
sq cert [Options]  SUBCOMMAND
sq key [Options]  SUBCOMMAND
sq pki [Options]  SUBCOMMAND
sq autocrypt [Options]  SUBCOMMAND
sq network [Options]  SUBCOMMAND
sq toolbox [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 `--no-cert-store`.  Similarly, a key store is used to manage and protect secret key material.  This can be disabled using `--no-key-store`.

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

--cert-store=PATH

Specifies the location of the certificate store.  By default, sq uses the OpenPGP certificate directory at `$HOME/.local/share/pgp.cert.d`, and creates it if it does not exist.

-f,  --force

Overwrites existing files

-h,  --help

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

--key-store=PATH

A key store server manages and protects secret key material.  By default, `sq` connects to the key store server listening on `$XDG_DATA_HOME/sequoia`.  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.

--keyring=PATH

Specifies 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

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

--no-cert-store

Disables the use of a certificate store.  Normally sq uses the user's standard cert-d, which is located in `$HOME/.local/share/pgp.cert.d`.

--no-key-store

Disables the use of the key store.

It is still possible to use functionality that does not require the key store.

--output-format=FORMAT

Produces output in FORMAT, if possible

--output-version=VERSION

Produces output variant Version, such as 0.0.0. The default is the newest version. The output version is separate from the version of the sq program. To see the current supported versions, use output-versions subcommand.

--pep-cert-store=PATH

Specifies the location of a pEp certificate store.  sq does not use a pEp certificate store by default; it must be explicitly enabled using this argument or the corresponding environment variable, PEP_CERT_STORE.  The pEp Engine's default certificate store is at `$HOME/.pEp/keys.db`.

--time=TIME

Sets 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 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 verify msg.pgp

--trust-root=FINGERPRINT|KEYID

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

Subcommands

sq encrypt

Encrypts a message.

Encrypts 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

Decrypts a message.

Decrypts 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-cert` 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.  In addition to that, the last 25 MiB of the message are withheld, i.e. if the message is smaller than 25 MiB, no output is produced, and if it is larger, then the output will be truncated.

The converse operation is `sq encrypt`.

sq sign

Signs 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

Verifies 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. In addition to that, the last 25 MiB of the message are withheld, i.e. if the message is smaller than 25 MiB, no output is produced, and if it is larger, then the output will be truncated.

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 inspect

Inspects 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

Manages 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

Manages 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 toolbox keyring` 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 autocrypt

Communicates certificates using Autocrypt.

Autocrypt is a standard for mail user agents to provide convenient end-to-end encryption of emails.  This subcommand provides a limited way to produce and consume headers that are used by Autocrypt to communicate certificates between clients.

See <https://autocrypt.org/>.

sq network

Retrieves and publishes 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 toolbox

Tools for developers, maintainers, and forensic specialists.

This is a collection of low-level tools to inspect and manipulate OpenPGP data structures.

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.

This command can also be used to query the output format versions for the machine-readable output of various subcommands, and the default output format versions.

Examples

sq encrypt

Encrypt a file using a certificate

    sq encrypt --recipient-file romeo.pgp message.txt

Encrypt a file creating a signature in the process

    sq encrypt --recipient-file romeo.pgp --signer-file juliet.pgp \
    message.txt

Encrypt a file using a password

    sq encrypt --symmetric message.txt

sq decrypt

Decrypt a file using a secret key

    sq decrypt --recipient-file juliet.pgp ciphertext.pgp

Decrypt a file verifying signatures

    sq decrypt --recipient-file juliet.pgp --signer-file romeo.pgp \
    ciphertext.pgp

Decrypt a file using a password

    sq decrypt ciphertext.pgp

sq sign

Create a signed message

    sq sign --signer-file juliet.pgp message.txt

Create a detached signature

    sq sign --detached --signer-file juliet.pgp message.txt

Create a signature with the specified creation time

    sq sign --time 20020304 --detached --signer-file juliet.pgp \
    message.txt

sq verify

Verify a signed message

    sq verify signed-message.pgp

Verify a detached message

    sq verify --detached message.sig message.txt

Verify a message as of June 9, 2011 at midnight UTC:

    sq verify --time 20130721 msg.pgp

sq inspect

Inspects a certificate

    sq inspect juliet.pgp

Inspects a certificate ring

    sq inspect certs.pgp

Inspects a message

    sq inspect message.pgp

Inspects a detached signature

    sq inspect message.sig

Show the certificate as it looked on July 21, 2013

    sq inspect --time 20130721 cert.pgp

See Also

sq-encrypt(1), sq-decrypt(1), sq-sign(1), sq-verify(1), sq-inspect(1), sq-cert(1), sq-key(1), sq-pki(1), sq-autocrypt(1), sq-network(1), sq-toolbox(1), sq-version(1).

For the full documentation see <https://book.sequoia-pgp.org>.

Version

0.34.0 (sequoia-openpgp 1.19.0)

Referenced By

dpkg-buildpackage(1), sq-autocrypt(1), sq-autocrypt-decode(1), sq-autocrypt-encode-sender(1), sq-autocrypt-import(1), sq-cert(1), sq-cert-export(1), sq-cert-import(1), sq-cert-lint(1), sq-decrypt(1), sq-encrypt(1), sq-inspect(1), sq-key(1), sq-key-adopt(1), sq-key-attest-certifications(1), sq-key-expire(1), sq-key-extract-cert(1), sq-key-generate(1), sq-key-import(1), sq-key-list(1), sq-key-password(1), sq-key-revoke(1), sq-key-subkey(1), sq-key-subkey-add(1), sq-key-subkey-revoke(1), sq-key-userid(1), sq-key-userid-add(1), sq-key-userid-revoke(1), sq-key-userid-strip(1), sq-network(1), sq-network-dane(1), sq-network-dane-fetch(1), sq-network-dane-generate(1), sq-network-fetch(1), sq-network-keyserver(1), sq-network-keyserver-fetch(1), sq-network-keyserver-publish(1), sq-network-wkd(1), sq-network-wkd-direct-url(1), sq-network-wkd-fetch(1), sq-network-wkd-generate(1), sq-network-wkd-url(1), sq-pki(1), sq-pki-authenticate(1), sq-pki-certify(1), sq-pki-identify(1), sq-pki-link(1), sq-pki-link-add(1), sq-pki-link-list(1), sq-pki-link-retract(1), sq-pki-list(1), sq-pki-lookup(1), sq-pki-path(1), sq-sign(1), sq-toolbox(1), sq-toolbox-armor(1), sq-toolbox-dearmor(1), sq-toolbox-keyring(1), sq-toolbox-keyring-filter(1), sq-toolbox-keyring-list(1), sq-toolbox-keyring-merge(1), sq-toolbox-keyring-split(1), sq-toolbox-packet(1), sq-toolbox-packet-decrypt(1), sq-toolbox-packet-dump(1), sq-toolbox-packet-join(1), sq-toolbox-packet-split(1), sq-verify(1), sq-version(1).

0.34.0 Sequoia PGP