I have a text file which I will call filename.txt
. Firstly I call
gpg --output filename.asc --clearsign filename.txt
Signed file filename.asc
is created. Then I call
gpg --armor --output filename.sig --detach-sign filename.asc
Signature is extracted from signed file filename.asc
and saved in filename.sig
.
My question is if it is possible somehow to merge original unsigned file filename.txt
and file with ASCII armored signature filename.sig
to make signed file? I see no such functionality in GPG, but maybe I don't know something? Or maybe is it possible with others tools (Java processing or anything)?
Simply merging this files results with failed signature verification. In my use case I need to sign file, reply with signature file (without content), then I receive separate siganture and conent file. I need to merge it and encrypt. For now I am not using --detach
switch and I just split signed file into two files and then I am simply merging them. But when I use --detach
switch siganture changes and it doesn't work when I merge siganture file with content file. It could stay the way it is right now, but I want to extract siganture in standard way using --detach
switch rather than just cutting signed file into pieces, but then I don't see an option to merge siganture exported with --detach
switch