How to sign a document on linux

The instructions to digitally sign a document are woefully inadequate.
I did the following:

# see https://websiteforstudents.com/self-signed-certificates-ubuntu-17-04-17-10/
name=dbk
openssl genrsa -aes128 -out $name.key 2048 #generate a key
#best to generate without a passphrase, so next command removes it
openssl rsa -in $name.key -out $name.key
# create a certificate signing request. This one is good for a year
days=365
openssl req -new -days $days -key $name.key -out $name.csr

openssl x509 -in $name.csr -out $name.crt -req -signkey $name.key -days $days

#make it readable only to you, to protect it
chmod 400 $name.*

In Libreoffice, I can click on File->DigitalSignatures and a requester comes up with an empty list.
I can start Certificate manager and see my self-signed certificate on the machine. So it’s there.

I could export it from the certificate manager, but that would just put it into a different directory. The certificate is already in my home directory under directory cert: /myhome/cert

I also exported

export MOZILLA_CERTIFICATE_HOLDER=/myhome/cert

which is the directory where the certificate is, but Libreoffice does not find it.
How exactly am I supposed to tell libreoffice where the certificate is? LibreOffice always shows a blank list of certificates to sign with.