This question is directly related to the Web Cryptography API;
I have generated an RSA key pair as per the example on MDN:
const keyPair = await crypto.subtle.generateKey(
{
name: "RSA-OAEP",
modulusLength: 4096,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
hash: "SHA-256",
},
true,
["encrypt", "decrypt"]
);
Is there any straightforward interface to extract the public numbers (exponent, modulus) from the public key?
Preferably as BigInt
.