MCPcopy Index your code
hub / github.com/nodejs/node / ecdsaSignVerify

Function ecdsaSignVerify

lib/internal/crypto/ec.js:228–250  ·  view source on GitHub ↗
(key, data, { name, hash }, signature)

Source from the content-addressed store, hash-verified

226}
227
228function ecdsaSignVerify(key, data, { name, hash }, signature) {
229 const mode = signature === undefined ? kSignJobModeSign : kSignJobModeVerify;
230 const type = mode === kSignJobModeSign ? 'private' : 'public';
231
232 if (getCryptoKeyType(key) !== type)
233 throw lazyDOMException(`Key must be a ${type} key`, 'InvalidAccessError');
234
235 return jobPromise(() => new SignJob(
236 kCryptoJobWebCrypto,
237 mode,
238 getCryptoKeyHandle(key),
239 undefined,
240 undefined,
241 undefined,
242 undefined,
243 data,
244 normalizeHashName(hash.name),
245 undefined, // Salt length, not used with ECDSA
246 undefined, // PSS Padding, not used with ECDSA
247 kSigEncP1363,
248 undefined,
249 signature));
250}
251
252module.exports = {
253 ecExportKey,

Callers

nothing calls this directly

Calls 5

getCryptoKeyTypeFunction · 0.85
lazyDOMExceptionFunction · 0.85
jobPromiseFunction · 0.85
getCryptoKeyHandleFunction · 0.85
normalizeHashNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…