Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
options = Object.assign({}, defaultOptions, options)
keys.generateKeyPair(options.algo, options.bits, (err, key) => {
if (err) { return reject(err) }
resolve({
'public': keys.marshalPublicKey(key.public),
'private': keys.marshalPrivateKey(key)
})
})
})
}
return new Promise((resolve, reject) => {
options = Object.assign({}, defaultOptions, options)
keys.generateKeyPair(options.algo, options.bits, (err, key) => {
if (err) { return reject(err) }
resolve({
read: encode(keys.marshalPublicKey(key.public)),
write: encode(keys.marshalPrivateKey(key))
})
})
})
}