sq-keyring-lint - Man Page

Checks certificates for issues


sq keyring lint [Options] FILE


Checks certificates for issues.

`sq keyring lint` checks the supplied certificates for the following SHA-1-related issues:

 - Whether a certificate revocation uses SHA-1.

 - Whether the current self signature for a non-revoked User ID uses

 - Whether the current subkey binding signature for a non-revoked,
   live subkey uses SHA-1.

 - Whether a primary key binding signature ("backsig") for a
   non-revoked, live subkey uses SHA-1.

Diagnostics are printed to stderr.  At the end, some statistics are shown.  This is useful when examining a keyring.  If `--fix` is specified and at least one issue could be fixed, the fixed certificates are printed to stdout.

This tool does not currently support smart cards.  But, if only the subkeys are on a smart card, this tool may still be able to partially repair the certificate.  In particular, it will be able to fix any issues with User ID self signatures and subkey binding signatures for encryption-capable subkeys, but it will not be able to generate new primary key binding signatures for any signing-capable subkeys.


Subcommand options

-B, --binary

Emits binary data

-F, --fix

Attempts to fix certificates, when possible

-e, --export-secret-keys

When fixing a certificate, the fixed certificate is exported without any secret key material.  Using this switch causes any secret key material to also be exported

-k, --list-keys

If set, outputs a list of fingerprints, one per line, of certificates that have issues.  This output is intended for use by scripts.

This option implies `--quiet`. If you also specify `--fix`, errors will still be printed to stderr, and fixed certificates will still be emitted to stdout.

-o, --output=FILE

Writes to FILE or stdout if omitted

-p, --password=PASSWORD

A key's password.  Normally this is not needed: if stdin is connected to a tty, the linter will ask for a password when needed

-q, --quiet

Quiet; does not output any diagnostics


A list of OpenPGP keyrings to process.  If none are specified, a keyring is read from stdin

Global options


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')


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.


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.


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


Produces output in FORMAT, if possible


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.


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


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


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.

Exit Status

If `--fix` is not specified:
 2  if any issues were found,
 1  if not issues were found, but there were errors reading the input,
 0  if there were no issues.

If `--fix` is specified:
 3  if any issues could not be fixed,
 1  if not issues were found, but there were errors reading the input,
 0  if all issues were fixed or there were no issues.


To gather statistics, simply run:

    sq keyring lint keyring.pgp

To fix a key:

    gpg --export-secret-keys FPR \
    | sq keyring lint --fix -p passw0rd -p password123 \

| gpg --import

To get a list of keys with issues:

    sq keyring lint --list-keys keyring.pgp \
    | while read FPR; do something; done

See Also

sq(1), sq-keyring(1).

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


0.33.0 (sequoia-openpgp 1.17.0)

Referenced By


0.33.0 Sequoia-PGP