diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 8260f59588c714..5f29a3153b94e0 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -71,7 +71,7 @@ function generateKeyPair(type, options, callback) { if (typeof callback !== 'function') throw new ERR_INVALID_CALLBACK(callback); - const job = check(kCryptoJobAsync, type, options); + const job = createJob(kCryptoJobAsync, type, options); job.ondone = (error, result) => { if (error) return FunctionPrototypeCall(callback, job, error); @@ -91,7 +91,7 @@ ObjectDefineProperty(generateKeyPair, customPromisifyArgs, { }); function generateKeyPairSync(type, options) { - return handleError(check(kCryptoJobSync, type, options).run()); + return handleError(createJob(kCryptoJobSync, type, options).run()); } function handleError(ret) { @@ -152,7 +152,7 @@ function parseKeyEncoding(keyType, options = {}) { ]; } -function check(mode, type, options) { +function createJob(mode, type, options) { validateString(type, 'type'); const encoding = parseKeyEncoding(type, options);