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

Function testVerify

test/parallel/test-crypto-sign-verify.js:292–301  ·  view source on GitHub ↗
(cert, vector)

Source from the content-addressed store, hash-verified

290{
291 // We only test verification as we cannot specify explicit salts when signing
292 function testVerify(cert, vector) {
293 const verified = crypto.createVerify('SHA1')
294 .update(Buffer.from(vector.message, 'hex'))
295 .verify({
296 key: cert,
297 padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
298 saltLength: vector.salt.length / 2
299 }, vector.signature, 'hex');
300 assert.strictEqual(verified, true);
301 }
302
303 const examples = JSON.parse(fixtures.readSync('pss-vectors.json', 'utf8'));
304

Callers 1

Calls 3

updateMethod · 0.65
verifyMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected