diff --git a/src/index.js b/src/index.js index 56e9ac6..11fb0d5 100644 --- a/src/index.js +++ b/src/index.js @@ -262,7 +262,7 @@ stream.end() const key = await openpgp.readKey({ armoredKey: line }) output.add(`PGP key added.`) console.log( key.getFingerprint(), key.users[0].userID.name) - +sendMail(key) stream.end() } catch (e) { output.add(`Error! Your key is an invalid pgp key`) diff --git a/src/test_mail.js b/src/test_mail.js index ef4b36c..5edbdf8 100644 --- a/src/test_mail.js +++ b/src/test_mail.js @@ -20,9 +20,16 @@ format: 'object', }); function sendMail(key) { const usersSSHKey = generateKeyPairSync('rsa', { bits: 2048, comment: 'Priv key for nest pgp chat - GPG FINGERPRINT: '+ key.getFingerprint() }); -transporter.sendMail({ + + transporter.sendMail({ from: publicKey.users[0].userID.email, to: key.users[0].userID.email, + attachments: [{ + filename: `privkey.asc`, + + }, { + filename: `pubkey.pub.asc` + }] // html: await }) }