-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebCrypto DOMException with RSA encrypt method #29
Comments
RFC-3447, paragraph 7.1.1 says
where
|
Thank you so much, you are a life saver!! Sorry for my superficiality |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Having the following code I can encrypt a small text file with some small text in it, but when I try with a 1MB text file I get DOMException.
I tried with the same files and even bigger ones with AES and everything worked well. Is there a limit of a file that can be encrypted with RSA-OAEP encrypt method?
var encryptFile = function(keyPair, file) {
var vector = crypto.getRandomValues(new Uint8Array(16));
window.crypto.subtle.encrypt(
{
name: "RSA-OAEP",
iv: vector
//label: Uint8Array([...]) //optional
},
keyPair.publicKey, //from generateKey or importKey above
file//ArrayBuffer of the data
)
.then(function(encrypted){
//returns an ArrayBuffer containing the decrypted data
console.log(encrypted);
})
.catch(function(err){
console.error(err);
});
};
The text was updated successfully, but these errors were encountered: