So I had to sign a PDF in my Linux box, here is a quick guide on how to do it.

  1. Installed a opensource PDF editor, so I opted for Okular.
  2. Then I generated both a private key (pdf_signing.key) and a self-signed certificate (pdf_signing.crt) to use for signing the documents, using openssl:
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout pdf_signing.key -out pdf_signing.crt -subj "/CN=Jose Alves/emailAddress=jose@alves.lol"
  1. Convert it to PKCS#12:
openssl pkcs12 -export -in pdf_signing.crt -inkey pdf_signing.key -out signing-certificate.p12 -name "Jose Alves"
  1. Import it to the NSS database (where Okular will search for it):
pk12util -d ~/.pki/nssdb -i signing-certificate.p12
  1. Open Okular and choose Tools > Digitally Sign..

How to sign PDFs in (Ubuntu) Linux