title: Generate RSA key-pair from "N", "E", "D" keys using crypto module
body: <p>i'm new to cryptography.</p>
  
  <p>I'm creating the RSA key-pairs using <code>crypto.generateKeyPairSync()</code> </p>
  
  <pre><code>const crypto = require('crypto')
  
  const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', {
    modulusLength: 2048,
    publicExponent: 3,
    publicKeyEncoding: {
      type: 'pkcs1',
      format: 'pem'
    },
    privateKeyEncoding: {
      type: 'pkcs1',
      format: 'pem'
    }
  })
  
  console.log(publicKey)
  console.log(privateKey)
  
  // print "n", "e", "d" keys
  </code></pre>
  
  <p>This works fine but the i need to extract the <code>"n", "e", "d"</code> keys so that an other app can encrypt and decrypt the messages. It would be great if this is possible without any 3rd-party libraries only the native NodeJS crypto module. </p>
  
  <p>Also if it's not possible to extract the <code>"n", "e", "d"</code> keys, would it be possible to create a new public and private key using existing <code>"n", "e", "d"</code> keys from an other app?</p>