I have already acquired a S/MIME certificate (a .p12 file) issued by an authority. Using it in Writer, I can digitally sign documents by following this procedure : How do I make a digital certificate available to LibreOffice Writer for digital signatures?

Can I do the same for PDF files? If yes, what method do you suggest me? I would prefer a solution that relies on Free Software.

share|improve this question

If you have the certificate available in Writer and if using its Export to PDF function, you can also digitally sign the resulting PDF from the last tab of the dialog right before the export.

AFAICT, Acrobat Reader for Android says the document is protected, FWIW.

Update '17: Since last December you can sign PDF files with LibreOffice by going File → Digital signatures → Sign exiting PDF.

That will open Draw which is capable of signing the PDF.

share|improve this answer

Your only option is Portable Signer, which is not in Ubuntu repositories.

You might expect Ubuntu document signing tools like qdigidoc or gpg would do, but no, they don't play with PDF signatures.

You might then expect Ubuntu PDF manipulation tools like qpdf, which provides encryption, or pdftk, which provides watermarking, to provide signing features too, but, no, they don't.

The total list of opensource tools available for your purpose is: http://wiki.cacert.org/PdfSigning

Unfortunately, none of the tools is currently maintained and none can be found in Ubuntu packages. Portable Signer is the most well maintained of all.

  • Portable Signer hasn't been updated since 2014 - this is the most well maintained among all.
  • jSignPdf hasn't been updated since 2013.
  • jPdfSign hasn't been updated since 2006.
  • CACert's PdfSigner uses outdated iText tool.
  • OpenSignature hasn't been updated since 2008.
  • Footprint's link is broken.
  • jPDFSecure (commercial) – updated in 2017 but it is a Java library not a user tool.
share|improve this answer

I found that you can use gpg to sign a PDF in a way that it still opens up in a viewer.

gpg --clearsign --output=signed.pdf input.pdf

Above would yield .asc file which is basically concatenation of input||signature but file extension is forced into .pdf making it to open in viewer, produce thumbnails, etc.

enter image description here

You can verify signature using gpg again.

$ gpg --verify signed.pdf 
gpg: Podpisano nie, 12 kwi 2015, 19:07:15 CEST z użyciem RSA kluczem
gpg: Poprawny podpis od "Arkadiusz Bulski <arek.bulski@gmail.com>"

Be warned that some pdfs dont work well with signing this way, such as optimised pdfs. You should check the results yourself.

share|improve this answer
    
Do PDF readers give any indication that this is a PGP-signed PDF? – Mendhak Jun 1 '17 at 19:20
    
No, PDF is viewed despite the attached signature. – ArekBulski Jun 2 '17 at 13:51
    
Perhaps GPG header will be ignored by some software, but Adobe Acrobat Reader and Foxit Reader don't like it and consider such PDF broken. So yes, mind interoperability problem. – dma_k Oct 6 '17 at 10:02
    
Interesting, but the question was about S/MIME certificates. – Andy Oct 25 '17 at 18:51

PDF Studio 7 Pro, available in the Software Center, features digital signing of PDFs. As of when I am writing it costs only 125 $.

According to the official website, it is indeed S/MIME signing.

share|improve this answer
8  
'only' $125. Hah! – wordsforthewise Sep 5 '16 at 1:54

You can sign PDF files with gpg/seahorse.

Learn more: https://help.ubuntu.com/community/GnuPrivacyGuardHowto

You can for instance use OpenSignPDF, that can be download here: http://opensignature.sourceforge.net/english.php

I hope this answers your question.

share|improve this answer
    
Thank you Subv3rsion! Alternatively, I also found some proprietary programs in the Ubuntu Software Center. But I am not going to make advertisement here. – Agmenor Jun 6 '12 at 17:58
3  
Ok, but please, can you tell me what programs did you found? – Octávio Filipe Gonçalves Jun 6 '12 at 18:02
    
Note that GPG and Seahorse might not like the S/MIME format that PDF(s) sometimes require in business environments. – Thomas Ward Jun 6 '12 at 18:15
1  
Some times, some people really need to sign with a .p12. This doesn't answer the question. – jgomo3 Feb 26 '14 at 0:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.