So I had to sign a PDF in my Linux box, here is a quick guide on how to do it.
- Installed a opensource PDF editor, so I opted for Okular.
- Then I generated both a private key (
pdf_signing.key
) and a self-signed certificate (pdf_signing.crt
) to use for signing the documents, usingopenssl
:
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"
- Convert it to PKCS#12:
openssl pkcs12 -export -in pdf_signing.crt -inkey pdf_signing.key -out signing-certificate.p12 -name "Jose Alves"
- Import it to the NSS database (where Okular will search for it):
pk12util -d ~/.pki/nssdb -i signing-certificate.p12
- Open Okular and choose
Tools > Digitally Sign..