PGP ops no longer require a key to be in date

This commit is contained in:
n1474335 2018-05-10 15:34:10 +00:00
parent 403296cc59
commit df7c1721f5

View file

@ -90,13 +90,16 @@ const PGP = {
try { try {
const key = await promisify(kbpgp.KeyManager.import_from_armored_pgp)({ const key = await promisify(kbpgp.KeyManager.import_from_armored_pgp)({
armored: privateKey, armored: privateKey,
opts: {
"no_check_keys": true
}
}); });
if (key.is_pgp_locked() && passphrase) { if (key.is_pgp_locked()) {
if (passphrase) { if (passphrase) {
await promisify(key.unlock_pgp.bind(key))({ await promisify(key.unlock_pgp.bind(key))({
passphrase passphrase
}); });
} else if (!passphrase) { } else {
throw "Did not provide passphrase with locked private key."; throw "Did not provide passphrase with locked private key.";
} }
} }
@ -118,6 +121,9 @@ const PGP = {
try { try {
const key = await promisify(kbpgp.KeyManager.import_from_armored_pgp)({ const key = await promisify(kbpgp.KeyManager.import_from_armored_pgp)({
armored: publicKey, armored: publicKey,
opts: {
"no_check_keys": true
}
}); });
return key; return key;
} catch (err) { } catch (err) {