Cleanup _pgpEncrypt
Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
parent
f49a3ac1ff
commit
4c8f31ffb0
@ -81,12 +81,11 @@ class Email {
|
|||||||
* @return {string} the encrypted PGP message block
|
* @return {string} the encrypted PGP message block
|
||||||
*/
|
*/
|
||||||
async _pgpEncrypt(plaintext, publicKeyArmored) {
|
async _pgpEncrypt(plaintext, publicKeyArmored) {
|
||||||
//const {keys: [key], err} =
|
let key;
|
||||||
let key;
|
try {
|
||||||
try {
|
key = await openpgp.readKey({armoredKey: publicKeyArmored});
|
||||||
key = await openpgp.readKey({armoredKey: publicKeyArmored});
|
} catch (err) {
|
||||||
} catch (err) {
|
log.error('email', 'Reading armored key failed.', err, publicKeyArmored);
|
||||||
log.error('email', 'Reading armored key failed.', err, publicKeyArmored);
|
|
||||||
}
|
}
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
// set message creation date if key has been created with future creation date
|
// set message creation date if key has been created with future creation date
|
||||||
|
Loading…
Reference in New Issue
Block a user