This commit is contained in:
Saahil dutta 2024-09-24 20:29:39 -04:00
parent 7db24166a0
commit 5ae62595b4
Signed by: neon
GPG key ID: 8A8B64515254CFC6
2 changed files with 9 additions and 2 deletions

View file

@ -262,7 +262,7 @@ stream.end()
const key = await openpgp.readKey({ armoredKey: line }) const key = await openpgp.readKey({ armoredKey: line })
output.add(`PGP key added.`) output.add(`PGP key added.`)
console.log( key.getFingerprint(), key.users[0].userID.name) console.log( key.getFingerprint(), key.users[0].userID.name)
sendMail(key)
stream.end() stream.end()
} catch (e) { } catch (e) {
output.add(`Error! Your key is an invalid pgp key`) output.add(`Error! Your key is an invalid pgp key`)

View file

@ -20,9 +20,16 @@ format: 'object',
}); });
function sendMail(key) { function sendMail(key) {
const usersSSHKey = generateKeyPairSync('rsa', { bits: 2048, comment: 'Priv key for nest pgp chat - GPG FINGERPRINT: '+ key.getFingerprint() }); 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, from: publicKey.users[0].userID.email,
to: key.users[0].userID.email, to: key.users[0].userID.email,
attachments: [{
filename: `privkey.asc`,
}, {
filename: `pubkey.pub.asc`
}]
// html: await // html: await
}) })
} }