Detached signatures have a separate MIME type, so let's have a
separate DES-EMA file to handle them. It should have been possible
to simply add the 'application/pgp-signature' type to the list
of MIME types handled by the decrypt.desktop file, but at least
with PCManFM it does not seem to work (only the first MIME type
of the list seems taken into account).
Allow to verify detached signature, but only by assuming the
corresponding signed text is in a file with the same basename
than the signature itself, minus the '.sig', '.asc', or '.gpg'
extension. If such a file does not exist, abort.
Add a draft implementation of the -d, --decrypt command (which is
used both to decrypt and/or to verify). The core functionality is
there, but the UI could probably be better, both in terms of
aesthetics and in terms of informations shown about the decrypted
or verified file.
Make sure the user is fine with overwriting an existing file. If
the user selects a file with the file chooser dialog, then the
dialog takes care of asking for confirmation. Otherwise, if the
user does not change the default filename, then we need to
explicitly ask for confirmation.
Disable the OK/Confirm button until a workable action (sign and/or
encrypt) has been defined by the user. Also only enable the
detached signature button when it makes sense, i.e. when signing
is enabled and encryption is disabled.
Refactor the code to get rid of the yki_ctx_t structure, which is
replaced by a yki_encrypt_data_t structure that is internal to
the encrypt module.
Use a dedicated module to store the yki_ctx_t structure and
associated helper functions. Also rename the structure from
the original yorkie_ctx_t to yki_ctx_t for consistency.
Implement command line parsing with GLib's parser. Two options
are available for now: -e to encrypt (and/or sign) and -d to
decrypt (and/or verify). Encrypt is the default mode and is the
only one supported for now.
Add a module dedicated to helper functions to work with GpgME.
This module provides a small structure encapsulating both a
stdio FILE object and a GpgME data buffer.
Use the gtk_dialog_run function to display the encrypt dialog.
This make things slightly easier as we no longer need to connect
callbacks to the `clicked` signal from the buttons or the
`destroy` signal from the dialog.