--clearsign vs. --armor

May 30, 2013 at 10:27 PM
Hi there,

I've seen in the source code that while the "Armored" property for GpgEncrypt correctly translates to "--armor " it becomes "--clearsign" in GpgSign. If I understand it correctly, "--clearsign" and "--armor" are not equal. When signing a file one of the following signing modes can be chosen:
-s, --sign
Make a signature. This command may be combined with --encrypt.
Make a clear text signature.

-b, --detach-sign
Make a detached signature.
Source: http://www.gnupg.org/gph/de/manual/r1023.html

The "--armor" option can be added to either of these modes (although it seems to have no effect when using it with "--clearsign").

Wouldn't it be better to have an enum - say SigMode - that's passed to GpgSign? I'm thinking of something like
public GpgSign(KeyId signatureKeyId, String fileName, String signedFileName, SignMode mode, Boolean armored)
    // ...
That way even detached AND armored signatures would be possible. Exactly what I need ;) I could implement it myself, but I thought that it might be of interest for others, too.

May 31, 2013 at 10:18 PM
Edited May 31, 2013 at 10:21 PM
Hello Aleks,

Good idea!

I will try to implement this feature in a near future. I can't do the changes currently because I'm very busy, but I keep this in mind.
Thanks !