Private key:
openssl genrsa -out private.key 1024
Public key:
openssl rsa -in private.key -out mail.key.pem -pubout -outform PEM
The first part of the filename mail.key.pem is the selector.
To get the text record, run this perl snippet:
perl -e '@l = <>; shift @l; pop @l; chomp @l; print qq(TXT record: "k=rsa; t=y; p=), join("", @l), qq("\n)' < mail.key.pem
Remove "t=y" when you are done testing.
Add the record to your DNS zone:
mail._domainkey.example.com. IN TXT "..."
Add the record for ADSP:
_adsp._domainkey.example.com. IN TXT "dkim=unknown"