mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-07 17:41:33 +00:00
Check if any (sub)key is decrypted in Key.prototype.isDecrypted (#1182)
`key.isDecrypted()` now returns true if either the primary key or any subkey is decrypted. Additionally, implement `SecretKeyPacket.prototype.makeDummy` for encrypted keys.
This commit is contained in:
@@ -208,7 +208,7 @@ export class Message {
|
||||
// do not check key expiration to allow decryption of old messages
|
||||
const privateKeyPackets = (await privateKey.getDecryptionKeys(keyPacket.publicKeyId, null)).map(key => key.keyPacket);
|
||||
await Promise.all(privateKeyPackets.map(async function(privateKeyPacket) {
|
||||
if (!privateKeyPacket) {
|
||||
if (!privateKeyPacket || privateKeyPacket.isDummy()) {
|
||||
return;
|
||||
}
|
||||
if (!privateKeyPacket.isDecrypted()) {
|
||||
|
||||
Reference in New Issue
Block a user