Hi folks,
I am using forge's pkcs#7 encryption which is actually working fine :-)
The following code works in Firefox for filesizes up to 500MB + maybe more (not tested for bigger files than that).
But Chrome allocates much more memory than FF and crashes due to out of memory exceptions with a file size of 167MB already! Tested with latest Chrome (78.0.3904.97) on Windows 10 64 Bit .
Can anyone help?
Thanks in advance!
Here is the code:
var reader = new FileReaderSync();
var encryptedData = createPKCS7(reader.readAsBinaryString(file),global_certData);
// buffer: File as binary string
function createPKCS7(buffer, certData)
{
// create enveloped data
var p7 = forge.pkcs7.createEnvelopedData();
// add certificate of pkcs#12 as recipient
p7.addRecipient(certData.cert);
// set content
p7.content = forge.util.createBuffer(buffer);
// encrypt
p7.encrypt(); // crashes with chrome & big files
// convert to Der format
var p7Der = forge.asn1.toDer(p7.toAsn1());
return forge.util.binary.raw.decode(p7Der.getBytes()); //return pkcs7Der
}
Hi folks,
I am using forge's pkcs#7 encryption which is actually working fine :-)
The following code works in Firefox for filesizes up to 500MB + maybe more (not tested for bigger files than that).
But Chrome allocates much more memory than FF and crashes due to out of memory exceptions with a file size of 167MB already! Tested with latest Chrome (78.0.3904.97) on Windows 10 64 Bit .
Can anyone help?
Thanks in advance!
Here is the code: