I've generated private key and public key using following commands.
openssl genrsa -des3 -out server.key openssl rsa -in server.key -out server.key.insecure
mv server.key server.key.secure mv server.key.insecure server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
it shows error message while verifying for DKIM that public key(server.crt) should not be longer than 512 character.