OpenPGP improvements (first step)

openpgpjs: 0.7.2 -> 0.10.1
additional fixes
This commit is contained in:
RainLoop Team 2015-06-23 01:33:27 +04:00
parent 09334159c2
commit 34a9b8cbc5
28 changed files with 1363 additions and 644 deletions

View file

@ -62,29 +62,36 @@
_.delay(function () {
mKeyPair = false;
var mPromise = false;
try {
mKeyPair = PgpStore.openpgp.generateKeyPair({
mPromise = PgpStore.openpgp.generateKeyPair({
'userId': sUserID,
'numBits': Utils.pInt(self.keyBitLength()),
'passphrase': Utils.trim(self.password())
});
} catch (e) {
// window.console.log(e);
}
if (mKeyPair && mKeyPair.privateKeyArmored)
{
oOpenpgpKeyring.privateKeys.importKey(mKeyPair.privateKeyArmored);
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
oOpenpgpKeyring.store();
mPromise.then(function () {
require('App/User').reloadOpenPgpKeys();
Utils.delegateRun(self, 'cancelCommand');
}
self.submitRequest(false);
if (mKeyPair && mKeyPair.privateKeyArmored)
{
oOpenpgpKeyring.privateKeys.importKey(mKeyPair.privateKeyArmored);
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
oOpenpgpKeyring.store();
require('App/User').reloadOpenPgpKeys();
Utils.delegateRun(self, 'cancelCommand');
}
})['catch'](function() {
self.submitRequest(false);
});
} catch (e) {}
self.submitRequest(false);
}, 100);
return true;