title: Generating an RSA Key Pair with Erlang?
body: <p>Erlang has a crypto function which generates public private keys (documentation copied below).  However the documentation seems vague and I can't find any example code that describes how to generate the shared prime number or the generator.  Can someone post an example that generates a public/private key pair?  Thanks in advance for any help!</p>
  
  <pre><code>dh_generate_key(DHParams) -&gt; {PublicKey,PrivateKey} 
  dh_generate_key(PrivateKey, DHParams) -&gt; {PublicKey,PrivateKey} 
  </code></pre>
  
  <p>Types:
  DHParameters = [P, G]
  P, G = Mpint
  Where P is the shared prime number and G is the shared generator.
  PublicKey, PrivateKey = Mpint()
  Generates a Diffie-Hellman PublicKey and PrivateKey (if not given).</p>