我正在Chrome(自从第一个Web Crypto支持以来),Firefox(自有第一个Web Crypto支持以来)以及甚至在Safari TP(10.2)上都成功使用了Web Crypto API(https://www.w3.org/TR/WebCryptoAPI/)在WebCrypto Liner的支持下,WebCrypto API的pollyfill(https://github.com/PeculiarVentures/webcrypto-liner)。
现在,我想使用Microsoft Edge测试我们的代码。但是加密和解密样本ArrayBuffer已经失败。这里的代码:
var crypto = window.crypto;
if (crypto.subtle) {
var aesGcmKey = null;
// always create a new, random iv in production systems!!!
var tempIv = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
// needed for edge, if additional data missing decrypting is failing
var tempAdditionalData = new Uint8Array(0);
var dataToEncrypt = new Uint8Array([1, 2, 3, 4, 5]); …Run Code Online (Sandbox Code Playgroud)