How to import and export a certificate

A certificate which is stored in a file can be imported into the certificate store as follows:

$ sq cert import $FILE

To export a certificate from the cert store:

$ sq cert export $QUERY

To export an invalid certificate (for example, one which uses an SHA1 signature), you can pass --policy-as-of, using a date which pre-dates the deprecation date of said function:

$ sq cert export --cert-email alice@example.com --policy-as-of 20070101

To export all certificates, including the invalid ones, use this query:

$ sq cert export --all

Read more about importing and exporting certificates.