JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://rawgit.com/bitwiseshiftleft/sjcl/master/sjcl.js"></script>
<script src="https://rawgit.com/ForbesLindesay/promisejs.org/master/polyfills/output/promise-7.0.4.min.js"></script>

JavaScript

function generate() {
    return window.crypto.subtle.generateKey(
    {
        name: "RSA-OAEP",
        modulusLength: 2048, 
        publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
        hash: {name: "SHA-256"}, 
        ext: true
    },
    true, 
    ["encrypt", "decrypt"] 
    ).then(function (key) {
    	window.crypto.subtle.exportKey("raw", key.privateKey).then(function(key2){console.log(key2)})
    })
    .catch(function (err) {
        console.error(err);
    });
}
generate();