(type, options, callback)
| 416 | } |
| 417 | |
| 418 | function generateKey(type, options, callback) { |
| 419 | if (typeof options === 'function') { |
| 420 | callback = options; |
| 421 | options = undefined; |
| 422 | } |
| 423 | |
| 424 | validateFunction(callback, 'callback'); |
| 425 | |
| 426 | const job = generateKeyJob(kCryptoJobAsync, type, options); |
| 427 | |
| 428 | job.ondone = (error, key) => { |
| 429 | if (error) return FunctionPrototypeCall(callback, job, error); |
| 430 | FunctionPrototypeCall(callback, job, null, wrapKey(key, SecretKeyObject)); |
| 431 | }; |
| 432 | |
| 433 | handleGenerateKeyError(job.run()); |
| 434 | } |
| 435 | |
| 436 | function generateKeySync(type, options) { |
| 437 | return handleGenerateKeyError( |
no test coverage detected
searching dependent graphs…