35 lines
893 B
HTML
35 lines
893 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
<script src="../resources/common.js"></script>
|
|
</head>
|
|
<body>
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
|
|
<script>
|
|
description("Test importing a PBKDF2 raw key");
|
|
|
|
jsTestIsAsync = true;
|
|
|
|
var nonExtractable = false;
|
|
var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr");
|
|
|
|
crypto.subtle.importKey("raw", rawKey, { name: "PBKDF2" }, nonExtractable, ["deriveKey", "deriveBits"]).then(function(result) {
|
|
publicKey = result;
|
|
|
|
shouldBe("publicKey.toString()", "'[object CryptoKey]'");
|
|
shouldBe("publicKey.type", "'secret'");
|
|
shouldBe("publicKey.extractable", "false");
|
|
shouldBe("publicKey.algorithm.name", "'PBKDF2'");
|
|
shouldBe("publicKey.usages", "['deriveBits', 'deriveKey']");
|
|
|
|
finishJSTest();
|
|
})
|
|
</script>
|
|
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|