If you already have your signature recognized by Firefox, then poppler can be used to sign PDFs with certificates:
- Install poppler (
sudo apt install poppler-utils on Debian systems)
- List the signature nicknames available to you from Firefox:
pdfsig -list-nicks
- Apply the signature to the specified field in the document (either by field name or index in the document):
pdfsig -nick <NICKNAME> -sign <FIELD> <INPUT-PDF> <OUTPUT-PDF>
If you are looking to apply signatures to a document that does not have signature fields then that's also possible, but because of the way you asked your question I suspect that's not what you are looking for.