1

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?

  • 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 Apr 4 at 9:58
  • 1
    Are you looking for --armor? – AndrolGenhald Apr 4 at 13:10
  • @n0idea I want to be able to upload the signature into a box that only accepts ASCII. – Aaron Franke Apr 4 at 18:29
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.