| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| <script type="text/javascript"> |
| description("Test importing a HKDF raw key"); |
| var nonExtractable = false; |
| var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); |
| crypto.subtle.importKey("raw", rawKey, { name: "HKDF" }, nonExtractable, ["deriveKey", "deriveBits"]).then(function(result) { |
| shouldBe("publicKey.toString()", "'[object CryptoKey]'"); |
| shouldBe("publicKey.type", "'secret'"); |
| shouldBe("publicKey.extractable", "false"); |
| shouldBe("publicKey.algorithm.name", "'HKDF'"); |
| shouldBe("publicKey.usages", "['deriveBits', 'deriveKey']"); |
| <script src="../../resources/js-test-post.js"></script> |