title: Using Node.js crypto generate multiple pairs of public/private key
body: <p>How to generate multi pairs of the key using crypto in Node.js</p>
  
  <p>In node.js there is this code to generate pairs. but if I change the name to <code>{key, public_key}</code> then trying <code>console.log</code> them, it prints <code>undefined</code>. However, I need two pairs, can't run it twice with the same names, or it tells they are defined before. is there another way to generate another pair with crypto?</p>
  
  <pre><code>const { publicKey, privateKey } = generateKeyPairSync('rsa', {
    modulusLength: 4096,
    publicKeyEncoding: {
      type: 'spki',
      format: 'pem'
    },
    privateKeyEncoding: {
      type: 'pkcs8',
      format: 'pem',
      cipher: 'aes-256-cbc',
      passphrase: 'top secret'
    }
  });
  </code></pre>
  
  <p>key: undefined
  pub_key: undefined</p>
  
  <p>or:</p>
  
  <pre><code>{ privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
                        ^
  
  SyntaxError: Unexpected token =
  </code></pre>