Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.from = (_publicKey, _privateKey, callback) => {
console.log('creating keys from', _publicKey.length, _privateKey && _privateKey.length)
const publicKey = crypto.unmarshalPublicKey(_publicKey)
if (!_privateKey) {
return callback(null, {
'public': publicKey
})
}
crypto.unmarshalPrivateKey(_privateKey, (err, privateKey) => {
if (err) { return callback(err) }
callback(null, {
'public': publicKey,
'private': privateKey
})
})
}