Javascript 在IE11中包装密钥时不支持错误
下面是一个非常简单的测试,它生成两个键,然后尝试使用另一个来包装一个键。Internet Explorer 11中的“wrapKey”调用抛出了“NotSupportedError”,我不知道它到底指的是什么/抱怨的是什么 非常欢迎提供提示/建议!根据文档,用于包装RSA-OAEP的算法应该得到支持。。。我不太明白wrapKey方法在JSON Web key JWK结构中保护密钥材料的原理,该结构用JSON Web Encryption JWE封装。具体而言,密钥的密钥材料使用随机生成的内容加密密钥进行加密,然后使用指定的KeyWrappingGalgorithm使用keyEncryptionKey进行加密。-听起来好像是在谈论一些我理论上不需要在调用代码中担心的幕后/幕后工作Javascript 在IE11中包装密钥时不支持错误,javascript,internet-explorer,encryption,rsa,webcrypto-api,Javascript,Internet Explorer,Encryption,Rsa,Webcrypto Api,下面是一个非常简单的测试,它生成两个键,然后尝试使用另一个来包装一个键。Internet Explorer 11中的“wrapKey”调用抛出了“NotSupportedError”,我不知道它到底指的是什么/抱怨的是什么 非常欢迎提供提示/建议!根据文档,用于包装RSA-OAEP的算法应该得到支持。。。我不太明白wrapKey方法在JSON Web key JWK结构中保护密钥材料的原理,该结构用JSON Web Encryption JWE封装。具体而言,密钥的密钥材料使用随机生成的内容加密
var rsaOaepAlgo = { name: "RSA-OAEP",
modulusLength: 2048,
hash: { name: 'SHA-256' },
publicExponent: new Uint8Array([0x01, 0x00, 0x01]) }
var aesCbcAlgo = { name: "AES-CBC",
length: 128 }
var p = webcrypto.subtle.generateKey(
rsaOaepAlgo,
true,
["wrapKey", "unwrapKey", "encrypt", "decrypt"]
)
return webcrypto.promisify(p)
.then(function(generatedWrapKey) {
console.log('generated wrap key')
keyToUseForWrapping = generatedWrapKey
p = webcrypto.subtle.generateKey(aesCbcAlgo, true, ["encrypt", "decrypt"])
return webcrypto.promisify(p)
})
.then(function(importedKey) {
console.log('imported key to wrap successfully')
keyToUseForEncryption = importedKey
console.log(keyToUseForWrapping.publicKey.algorithm)
console.log(keyToUseForEncryption.algorithm)
console.log('attempting to wrap the key')
p = webcrypto.subtle.wrapKey(keyToUseForEncryption, keyToUseForWrapping.publicKey, rsaOaepAlgo)
return webcrypto.promisify(p)
})
你解决了这个问题吗?最终利用了Artem在github上的handy项目:好吧,我也测试了这个项目,但它不能与我需要的AES-KW一起工作。