Generate RSA key pair using WebCrypto API and protect it with passphrase
问题 title says it all. I was wondering how do I generate RSA key pair using WebCrypto API and how do I secure it with a passphrase so I can store it in a database. 回答1: You can generate an RSA key pair with WebCrypto and export it as jwk (Json Web Key), pkcs#8 (private) or spki (public). See SubtleCrypto.exportKey() and the example code bellow To export the key to an external system in a protected way you could use an standard like: PKCS#8: The PKCS#8 private key format defined at IETF Public Key