MCPcopy Create free account
hub / github.com/nodejs/node / testDeriveKeyBadUsage

Function testDeriveKeyBadUsage

test/pummel/test-webcrypto-derivebits-pbkdf2.js:577–596  ·  view source on GitHub ↗
(
  noKey,
  size,
  saltSize,
  hash,
  iterations,
  keyType,
  usages)

Source from the content-addressed store, hash-verified

575}
576
577async function testDeriveKeyBadUsage(
578 noKey,
579 size,
580 saltSize,
581 hash,
582 iterations,
583 keyType,
584 usages) {
585 const algorithm = {
586 name: 'PBKDF2',
587 salt: Buffer.from(kSalts[saltSize], 'hex'),
588 iterations,
589 hash,
590 };
591
592 return assert.rejects(
593 subtle.deriveKey(algorithm, noKey[size], keyType, true, usages), {
594 message: /baseKey does not have deriveKey usage/,
595 });
596}
597
598async function testWrongKeyType(
599 wrongKey,

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected