mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Added: GnuPG encrypt (sign still fails)
This commit is contained in:
parent
f3717815e1
commit
8fff6fa759
11 changed files with 196 additions and 91 deletions
|
|
@ -150,12 +150,16 @@ export const GnuPGUserStore = new class {
|
|||
return length && length === count;
|
||||
}
|
||||
|
||||
getPrivateKeyFor(query, sign) {
|
||||
return findGnuPGKey(this.privateKeys, query, sign);
|
||||
getPublicKeyFingerprints(recipients) {
|
||||
const fingerprints = [];
|
||||
recipients.forEach(email => {
|
||||
fingerprints.push(this.publicKeys.find(key => key.emails.includes(email)).fingerprint);
|
||||
});
|
||||
return fingerprints;
|
||||
}
|
||||
|
||||
getPublicKeyFor(query, sign) {
|
||||
return findGnuPGKey(this.publicKeys, query, sign);
|
||||
getPrivateKeyFor(query, sign) {
|
||||
return findGnuPGKey(this.privateKeys, query, sign);
|
||||
}
|
||||
|
||||
async decrypt(message) {
|
||||
|
|
@ -207,12 +211,8 @@ export const GnuPGUserStore = new class {
|
|||
}
|
||||
}
|
||||
|
||||
async sign(/*text, privateKey, detached*/) {
|
||||
throw 'Sign failed';
|
||||
}
|
||||
|
||||
async encrypt(/*text, recipients, signPrivateKey*/) {
|
||||
throw 'Encrypt failed';
|
||||
async sign(privateKey) {
|
||||
return await askPassphrase(privateKey);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue