From 5ae62595b40582f13508c4ae5c482ce3b3e6c48c Mon Sep 17 00:00:00 2001 From: Saahil Date: Tue, 24 Sep 2024 20:29:39 -0400 Subject: [PATCH] idk --- src/index.js | 2 +- src/test_mail.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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 }) }