7

If I use gpg --detach-sig file, then I get a small file.sig, but it is not plain text, so this is not useful if you wish to send the signature in a plain text format.

If I use gpg --clearsign file, then I get file.asc which contains the whole file plus a plain text signature at the end of the file. For viewing the signature, this is not easy if the payload is something other than text, since you can't open the file as plain text if your text editor can't handle the raw payload data. And I would prefer the payload and signature be separate files.

If I use both of the arguments at once, gpg --detach-sig --clearsign file, it behaves identically to only --clearsign, basically ignoring --detach-sig.

How can I create a detached plain text GPG signature?

3
  • Your question seems a little bit unclear to me. Could you clarify what do you mean by so this is not useful if you wish to send the signature in a plain text format. ?
    – n0idea
    Commented Apr 4, 2019 at 9:58
  • 2
    Are you looking for --armor? Commented Apr 4, 2019 at 13:10
  • @n0idea I want to be able to upload the signature into a box that only accepts ASCII. Commented Apr 4, 2019 at 18:29

1 Answer 1

13

The command you want is:

gpg --detach-sig --armor file

This will create a detached signature and will armor it, i.e. encode it with ASCII.

See the GnuPG documentation for more information.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .