title: Can I create DKIM key using Openssl
body: <p>I created <code>private</code> and <code>public</code> key using <strong>OpenSSL</strong> via the following commands</p>
  
  <pre><code>openssl genrsa -out private.key 2048
  openssl rsa -in private.key -pubout -out public.key
  </code></pre>
  
  <p><strong>The Question is:</strong></p>
  
  <ul>
  <li>Is creating DKIM key (<code>private</code> and <code>public</code>) using <strong>Openssl</strong> is safe, Is <strong>Openssl</strong> the preferred tool to do that.</li>
  <li>Can I add the <code>public.key</code> to the domain’s DNS records (TXT).</li>
  <li>Can I used <code>private.key</code> to setup <strong>DKIM Signing</strong> using <a href="https://nodemailer.com/dkim/" rel="nofollow noreferrer">Nodemailer</a>.</li>
  </ul>
  
  <blockquote>
    <p>please provide references in your answer</p>
  </blockquote>
  
  <hr>
  
  <p>If the answer to above question is no which other tool should I use to do that? please provide the tool's commands that will generate the <strong>DKIM key (<code>private</code> and <code>public</code>)</strong></p>