exim.ro

Generator · RFC 6376 · RFC 8463

DKIM key generator

The sending server signs every message with the private key, and receivers check the signature with the public key in DNS. The key pair is made here, in your browser: the private key is not sent anywhere.

01The domain
02The selector

The key's name: the record lives at selector._domainkey.domain. The suggestion is the current month, so the next key gets another name.

03Key type
Nothing is sent to the server when generating.

From key to signed mail

  1. Generate the key pair and save the private key on the server that sends the mail.

  2. Publish the TXT record, then check that DNS serves the same key.

  3. Start signing with the new selector and send a message to the delivery test: the signature must show as pass.

The key with OpenSSL

The same key pair, made on your own computer. The first command writes the private key, the second prints the value for p=.

RSA 2048openssl
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out s202611.private
openssl pkey -in s202611.private -pubout -outform DER | openssl base64 -A
Ed25519openssl
openssl genpkey -algorithm ed25519 -out s202611.private
openssl pkey -in s202611.private -pubout -outform DER | tail -c 32 | openssl base64 -A

The TXT record, at s202611._domainkey. + domain: v=DKIM1; k=rsa; p= followed by the printed value (k=ed25519 for Ed25519).

DKIM keys in short

If your mail goes out through Google Workspace, Microsoft 365 or a hosting panel that signs by itself, use the key generated there: the private key has to stay with whoever signs.

Sources: RFC 6376 · RFC 8301 · RFC 8463