vim-gnupg icon indicating copy to clipboard operation
vim-gnupg copied to clipboard

Sign when writing files that were signed and verify signed files when opening

Open rhz opened this issue 9 years ago • 1 comments

Hi James,

By reading the source I got the impression that when writing files are only signed if the variable g:GPGPreferSign is set to 1, regardless of whether the file was signed to begin with. Assuming my interpretation of the code is right (I don't know any vimscript), I was wondering if the plugin should check if the encrypted file is signed while decrypting it and let b:GPGOptions += ["sign"] accordingly. gpg --decrypt tells you if the signature could be verified in the last 2 lines written to stderr:

gpg: Signature made ... using ... key ID ...
gpg: Good signature from ...

Using this same information signed files can be verified when opening them :)

Files that aren't signed just don't write those last 2 lines to stderr.

Cheers, Ricardo

rhz avatar Jun 23 '15 02:06 rhz

Hi @jamessan,

I have noticed as well that signed GPG files lose their signature when modified with the plugin. Like @rhz suggested, I believe signed files should remain signed after being edited.

Awesome plugin by the way! :)

jdelisle avatar Nov 20 '15 21:11 jdelisle