mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Update openpgpjs (1.2.0 -> 2.3.0) (#1023)
This commit is contained in:
parent
125d4e0282
commit
a655b94aba
19 changed files with 20792 additions and 195 deletions
|
|
@ -184,15 +184,28 @@
|
|||
{
|
||||
if (oPrivateKey && 0 === aPublicKeys.length)
|
||||
{
|
||||
oPromise = PgpStore.openpgp.signClearMessage([oPrivateKey], self.text());
|
||||
// oPromise = PgpStore.openpgp.signClearMessage([oPrivateKey], self.text()); // 1.2.0
|
||||
oPromise = PgpStore.openpgp.sign({
|
||||
data: self.text(),
|
||||
privateKeys: [oPrivateKey]
|
||||
});
|
||||
}
|
||||
else if (oPrivateKey && 0 < aPublicKeys.length)
|
||||
{
|
||||
oPromise = PgpStore.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, self.text());
|
||||
// oPromise = PgpStore.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, self.text()); // 1.2.0
|
||||
oPromise = PgpStore.openpgp.encrypt({
|
||||
data: self.text(),
|
||||
publicKeys: aPublicKeys,
|
||||
privateKeys: [oPrivateKey]
|
||||
});
|
||||
}
|
||||
else if (!oPrivateKey && 0 < aPublicKeys.length)
|
||||
{
|
||||
oPromise = PgpStore.openpgp.encryptMessage(aPublicKeys, self.text());
|
||||
// oPromise = PgpStore.openpgp.encryptMessage(aPublicKeys, self.text()); // 1.2.0
|
||||
oPromise = PgpStore.openpgp.encrypt({
|
||||
data: self.text(),
|
||||
publicKeys: aPublicKeys
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
|
|
@ -210,7 +223,7 @@
|
|||
{
|
||||
oPromise.then(function (mData) {
|
||||
|
||||
self.resultCallback(mData);
|
||||
self.resultCallback(mData.data);
|
||||
self.cancelCommand();
|
||||
|
||||
})['catch'](function (e) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
var
|
||||
self = this,
|
||||
sUserID = '',
|
||||
oUserIds = {},
|
||||
oOpenpgpKeyring = PgpStore.openpgpKeyring
|
||||
;
|
||||
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
sUserID = this.email();
|
||||
oUserIds['email'] = this.email();
|
||||
if ('' !== this.name())
|
||||
{
|
||||
sUserID = this.name() + ' <' + sUserID + '>';
|
||||
oUserIds['name'] = this.name();
|
||||
}
|
||||
|
||||
this.submitRequest(true);
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
try {
|
||||
|
||||
mPromise = PgpStore.openpgp.generateKeyPair({
|
||||
'userId': sUserID,
|
||||
'userId': oUserIds,
|
||||
'numBits': Utils.pInt(self.keyBitLength()),
|
||||
'passphrase': Utils.trim(self.password())
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue