Okay, so DKIM uses only 'raw' publickey crypto and not certificates, but some 'application' for it uses PKCS12 format which requires a certificate. That's pretty silly.
If you have OpenSSL, and on Linux you should, it has several ways to create a self-signed certificate from a private key. A self-signed certificate doesn't accomplish the main purpose certificates were designed for, of distributing trust from a (relatively) centralized source, but it does package a public key with some other data in the form of a certificate, which is often convenient, including here.
The simplest way is
req -new -x509 something like:
openssl req -new -x509 -key privatekey.pem -days N -out dummy.crt
# N is the number of days (from now) until the cert expires
# reliers may or may not care about expiration of selfsigned,
# but to avoid possible issues it is common to use a longish period
# like 5, 10 or 20 years (roughly 1825, 3650 or 7300 days)
To avoid being prompted for the subject name fields, which are probably meaningless here, you can specify a dummy name something like
-subj /CN=mydkim .
It is possible an application silly enough to use PKCS12 for this might want some particular extensions in the certificate; this opens a much broader field because there are about a dozen commonly-used X.509 extensions and hundreds or thousands of more obscure ones. If the 'application' document says anything about cert extensions, or you get an error related to them, post details.
Once you have the cert just use
openssl pkcs12 -export -in certfile -inkey privatekeyfile -out pkcs12file