[dywang@dywmac ~]$ gpg --sign --output=demo.pdf.sig demo.pdf You need a passphrase to unlock the secret key for user: "De-Yu Wang (rhcx) <dywang7@gamil.com>" 2048-bit RSA key, ID 907CE30E, created 2013-06-20 can't connect to `/home/dywang/.gnupg/S.gpg-agent': No such file or directory (pinentry-gtk-2:9349): GLib-GObject-CRITICAL **: Object class GtkSecureEntry doesn't implement property 'editing-canceled' from interface 'GtkCellEditable'
[dywang@dywmac ~]$ ll demo.pdf* -rw-rw-r--. 1 dywang dywang 1574142 May 31 18:59 demo.pdf -rw-rw-r--. 1 dywang dywang 1574045 May 31 19:09 demo.pdf.sig
[dywang@dywmac ~]$ gpg --verify demo.pdf.sig gpg: Signature made Thu 31 May 2018 07:09:51 PM CST using RSA key ID 907CE30E gpg: Good signature from "De-Yu Wang (rhcx) <dywang7@gamil.com>"
[dywang@dywmac ~]$ gpg --output a.pdf --decrypt demo.pdf.sig gpg: Signature made Thu 31 May 2018 07:09:51 PM CST using RSA key ID 907CE30E gpg: Good signature from "De-Yu Wang (rhcx) <dywang7@gamil.com>"
[dywang@dywmac ~]$ diff demo.pdf a.pdf