Signing PDFs with LibreOffice and CACERT

I received a PDF that I needed to sign. I have often had to print it, put ink on it, scan it. Some people scan their signature and stick it on digitally, but it isn’t clear to me what the point of that is. Anyone could do that! The ink on paper copy is supposed to be sent as a followup to the “fax”, and it is also important that it be done in an analogue that had small variations. The variations are what prove that it’s a real signature.

Sometimes, one can PGP sign the PDF and send that. But, the PDF standard contains the ability to embed signatures.

So the opportunity to do this occured, and I thought I’d figure out what to do. LibreOffice has this ability for awhile, but my experiences trying with LO/OO 6.x was poor. I have just installed LibreOffice 7.3. I wish they had a proper apt-get’able repository, btw.

I started by opening the document:

%soffice Sandelman-NCCoE-IoT-CN22-0049.pdf

I reviewed the document to make sure it was okay. I then went to File->Digital Signatures->Sign Existing PDF It then opened again, with the note: “This PDF is open in read-only mode to allow signing the existing file”, and it had a button “Sign Document”, but there is no private key connected yet.

Sign Document

So, to connect to a certificate store that has a private key, use the Tools menu. Select Options, and then under the LibreOffice menu, open Security.

Security Tab

At this point select the “Certificates” button, and you’ll get a list of NSS modules from your system and firefox profiles.

Point to NSS module from Firefox

Select the one that you want. I have quite a few firefox profiles. I picked one the one with my CACert Client certificate loaded. If you don’t have one, then you need to get one! See ../../blog/2022-03-02-cacert-client.

Select profile you want

I found that if I just clicked on “Save” that it would remove the signatures. I didn’t try Save-As, but Export Directly to PDF does work.

Export Directly to PDF