EasyGnuPG / egpg

Easy GnuPG, shell scripts to make GnuPG more accessible and easier to use. (Migrated to: https://gitlab.com/EasyGnuPG/egpg)
GNU General Public License v3.0
26 stars 5 forks source link

add sign functionality #71

Closed diveshuttam closed 6 years ago

diveshuttam commented 6 years ago

I have changed the commands using basename as otherwise the bash process was seperate and other egpg functions like call cmd_sign etc. were not accessible.

There is one thing left in here, for all gui commands we need to change pinentry-tty to something like pinentry-gtk or some other graphical user interface.

dashohoxha commented 6 years ago

I have changed the commands using basename as otherwise the bash process was seperate and other egpg functions like call cmd_sign etc. were not accessible.

:+1: I did not test it that far.

There is one thing left in here, for all gui commands we need to change pinentry-tty to something like pinentry-gtk or some other graphical user interface.

On cmd_init we set the configuration of gpg-agent to pinentry-program /usr/bin/pinentry-tty. Maybe the initialization for the GUI case should be a bit different. If we set no value at all for pinentry, I think that the default value is pinentry-gtk.

By the way, we also need to do something about gpg.conf because it is deprecated (or useless) in gnupg-2.2.

Another thing is that on the file config.sh we need to save a label as well. This is useful for the GUI case but also for the command line. The purpose of this label is to help the user distinguish clearly and easily one key from another (in a scenario when he may need to use more than one key). For example he may use one key for communicating with work colleagues, another one for communicating with friends, and a third one for communicating with family members. Each of these keys lives in a different context (homedir). Normally the user should be able to distinguish them from each-other by the key id (or fingerprint). However this is more difficult and error prone than distinguishing them by a simple and user friendly label. Maybe we should also allow the user to switch easily the context of egpg from the GUI.

diveshuttam commented 6 years ago

By the way, we also need to do something about gpg.conf because it is deprecated (or useless) in gnupg-2.2.

I think I have been misinterpreting some of the things here, I again read the discussion on gnupg-devel, It says that keyserver entries are deprecated they should be shifted to dirmngr.conf instead. So I think other things should work fine.

pinentry-program is to be given in gpg-agent.conf so there should be no problem there too. BTW I am just trying these things.

dashohoxha commented 6 years ago

In case that $file.signed already exists (it may be a fake or corrupted one) signing fails. I think that gpg in this case tries to ask whether it should override it or not, but since it is not running in interactive mode it fails silently.

dashohoxha commented 6 years ago

It looks OK as far as I have tested. You can merge it.