# Digitally sign PDF ## Install Okular PDF viewer ````{tabs} ```{code-tab} bash {{ arch_based }} sudo pacman -S okular ``` ```{code-tab} bash {{ debian_based }} TODO ``` ```` ## Import certificate into Mozilla Firefox You will need a `*.p12` file of your certificate (e.g. `sigen-ca g2 2483790412026.p12`). 1. Open Mozilla firefox and go to **Settings**. 2. Search for `certificates` and click **View Certificates** ![](./figs/firefox-cerificates.png) 3. Select **Your Certificates** and click **Import**. ![](figs/firefox-import-cert.png) 4. Now find your `*.p12` file and open it. Than enter your password (you should have gotten it when you claimed your certificate). You have successfully imported your certificate into Firefox. ## Add certificate in Okular 0. You should now have [certificate imported in Mozilla Firefox](#import-certificate-into-mozilla-firefox). 1. Create a directory to store your Okular certificates (e.g. `~/cert/okular`) ```bash mkdir -p ~/cert/okular ``` 1. Copy `key4.db` and `cert9.db` files from `~/.mozilla/firefox/XXXXXXXX.default-release/` (where`XXXXXXXX` is random string) to newly created directory. ```bash cp ~/.mozilla/firefox/18yapjsu.default-release/key4.db ~/cert/okular/ cp ~/.mozilla/firefox/18yapjsu.default-release/cert9.db ~/cert/okular/ ``` 2. Open Okular expand **Settings** tab and click **Configure Backends**. ![](figs/okular-configure-backends.png) 3. Now select **PDF** in the sidebar, select **Custom** in **Certificate Database** group and click **Open File Dialog** button to select previously created directory (e.g. `~/cert/okular`). ![](figs/okular-certificate-database.png) 4. Click **OK** and close Okular. Now you are ready to digitally sign PDF dockuments (after you reopen Okular).