Difference between revisions of "Template:Generating certificates and keys"

From Teltonika Networks Wiki
Line 2: Line 2:
  
 
<ul>  
 
<ul>  
  <li>Now we can start generating the certificates and keys. Begin with the '''certificate authority''' ('''CA''') - the root certificate file that will be used to sign other certificates and keys:
+
    <li>Now we can start generating the certificates and keys. Begin with the <b>certificate authority</b> (<b>CA</b>) - the root certificate file that will be used to sign other certificates and keys:
    <ul>
+
        <ul>
      <pre>build-ca</pre>
+
            <pre>./easyrsa build-ca nopass</pre>
    </ul>
+
        </ul>
'''NOTE''': you can press the "Enter" key when prompted to enter the values set in the ''vars.bat'' file earlier. Doing this will set the values to the default specified in ''vars.bat''. However, you should type in a meaningful '''Common Name'''.
+
    </li>
  </li>
+
    <li>Next, build the <b>server</b> certificate and key:
 
+
        <ul>
  <li>Next, build the '''server''' certificate and key:
+
            <pre>./easyrsa build-server-full server nopass</pre>
    <ul>
+
        </ul>
      <pre>build-key-server server</pre>
+
    </li>
    </ul>
+
    <li>Next, build certificates and keys for the <b>clients</b>:
'''NOTE''': once again, don't forget to specify a different Common Name (use the name "server" for easier management purposes). When prompted the sign and commit the certificate, type '''y''' and press "Enter".
+
        <ul>
  </li>
+
            <pre>./easyrsa build-client-full Client1 nopass</pre>
 
+
        </ul><b>Note</b>: replace 'Client1' with this client's Common Name (CN).
  <li>Next, build certificates and keys for the '''clients''':
+
    </li>
    <ul>
+
    <li>Lastly, generate <b>Diffie Hellman parameters</b>:
      <pre>build-key Client1</pre>
+
        <ul>
    </ul>
+
          <pre>./easyrsa gen-dh</pre>
'''TIP''': use the same Common Name as the certificate name (Client1 in this example). This will help you differentiate between clients easier. Pick meaningful names like "toms_PC", "company_maintenance", etc. Repeat this step as many times as you need, depending on the client quantity.
+
        </ul>
  </li>
+
      </li>
 
 
  <li>Lastly, generate '''Diffie Hellman parameters''':
 
    <ul>
 
      <pre>build-dh</pre>
 
    </ul>
 
  </li>
 
 
</ul>
 
</ul>

Revision as of 12:34, 29 October 2020

Step 3: generating certificates and keys

  • Now we can start generating the certificates and keys. Begin with the certificate authority (CA) - the root certificate file that will be used to sign other certificates and keys:
      ./easyrsa build-ca nopass
  • Next, build the server certificate and key:
      ./easyrsa build-server-full server nopass
  • Next, build certificates and keys for the clients:
      ./easyrsa build-client-full Client1 nopass
    Note: replace 'Client1' with this client's Common Name (CN).
  • Lastly, generate Diffie Hellman parameters:
      ./easyrsa gen-dh