Lines Matching full:options
66 const { getOptionValue } = require('internal/options');
80 function generateKeyPair(type, options, callback) { argument
81 if (typeof options === 'function') {
82 callback = options;
83 options = undefined;
87 const job = createJob(kCryptoJobAsync, type, options);
107 function generateKeyPairSync(type, options) { argument
108 return handleError(createJob(kCryptoJobSync, type, options).run());
128 function parseKeyEncoding(keyType, options = kEmptyObject) { argument
129 const { publicKeyEncoding, privateKeyEncoding } = options;
141 throw new ERR_INVALID_ARG_VALUE('options.publicKeyEncoding',
157 throw new ERR_INVALID_ARG_VALUE('options.privateKeyEncoding',
171 function createJob(mode, type, options) { argument
174 const encoding = new SafeArrayIterator(parseKeyEncoding(type, options));
176 if (options !== undefined)
177 validateObject(options, 'options');
183 validateObject(options, 'options');
184 const { modulusLength } = options;
185 validateUint32(modulusLength, 'options.modulusLength');
187 let { publicExponent } = options;
191 validateUint32(publicExponent, 'options.publicExponent');
205 } = options;
210 validateInt32(saltLength, 'options.saltLength', 0);
212 validateString(hashAlgorithm, 'options.hashAlgorithm');
214 validateString(mgf1HashAlgorithm, 'options.mgf1HashAlgorithm');
217 '"options.hash" is deprecated, ' +
218 'use "options.hashAlgorithm" instead.',
221 validateString(hash, 'options.hash');
223 throw new ERR_INVALID_ARG_VALUE('options.hash', hash);
228 '"options.mgf1Hash" is deprecated, ' +
229 'use "options.mgf1HashAlgorithm" instead.',
232 validateString(mgf1Hash, 'options.mgf1Hash');
234 throw new ERR_INVALID_ARG_VALUE('options.mgf1Hash', mgf1Hash);
250 validateObject(options, 'options');
251 const { modulusLength } = options;
252 validateUint32(modulusLength, 'options.modulusLength');
254 let { divisorLength } = options;
258 validateInt32(divisorLength, 'options.divisorLength', 0);
268 validateObject(options, 'options');
269 const { namedCurve } = options;
270 validateString(namedCurve, 'options.namedCurve');
271 let { paramEncoding } = options;
277 throw new ERR_INVALID_ARG_VALUE('options.paramEncoding', paramEncoding);
309 validateObject(options, 'options');
310 const { group, primeLength, prime, generator } = options;
319 validateString(group, 'options.group');
328 validateBuffer(prime, 'options.prime');
330 validateInt32(primeLength, 'options.primeLength', 0);
333 'At least one of the group, prime, or primeLength options');
337 validateInt32(generator, 'options.generator', 0);
353 function generateKeyJob(mode, keyType, options) { argument
355 validateObject(options, 'options');
356 const { length } = options;
359 validateInteger(length, 'options.length', 8, 2 ** 31 - 1);
362 validateOneOf(length, 'options.length', kAesKeyLengths);
385 function generateKey(type, options, callback) { argument
386 if (typeof options === 'function') {
387 callback = options;
388 options = undefined;
393 const job = generateKeyJob(kCryptoJobAsync, type, options);
403 function generateKeySync(type, options) { argument
405 generateKeyJob(kCryptoJobSync, type, options).run());