key algorithm (RSA or EC)
Optional
opt1: string | numberRSA key length or EC curve name (P-{256,384,512}) RSA key length default is 2048 and EC curve name default is "P-256"
Optional
opt2: stringRSA public exponent as hexadecimal string. The default is "010001" (i.e. 65537)
Array of private key JWK and public key JWK.
This function generates a RFC 7517 JSON Web Key (JWK) RSA or EC key pair by W3C Web Crypto API.
await generateKeyPairJWK("EC") -> [{
kty: "EC",
crv: "P-256"
d: "..."
...
},{
kty: "EC",
crv: "P-256"
x: "...",
y: "...",
}]
generate keypair as JWK keys