diff --git a/encryption-pgp/encryption-pgp.qml b/encryption-pgp/encryption-pgp.qml index 158c2b9..c6cfff6 100644 --- a/encryption-pgp/encryption-pgp.qml +++ b/encryption-pgp/encryption-pgp.qml @@ -21,8 +21,8 @@ QtObject { }, { "identifier": "publicKey", - "name": "Public PGP Key", - "description": "Please enter your public pgp key:", + "name": "Public PGP Keys", + "description": "Please enter your ';'-separated public pgp keys or their emails:", "type": "string", "default": "F5161BD3", }, @@ -45,9 +45,17 @@ QtObject { * @return the exncrypted or decrypted text */ function encryptionHook(text, password, decrypt) { + var encryptCommand = ["--encrypt", "--armor"]; + // split public keys for gpg call + var pubKeys = publicKey.split(';'); + for (var i = 0; i < pubKeys.length; i++) { + encryptCommand.append("-r"); + encryptCommand.append(pubKeys[i]); + } + // encrypt the text for public key or decrypt with gpg // decryption will only work if you don't have to enter a password - var param = decrypt ? ["--decrypt"] : ["--encrypt", "--armor", "-r", publicKey]; + var param = decrypt ? ["--decrypt"] : encryptCommand; var result = script.startSynchronousProcess(gpgPath, param, text); return result; } diff --git a/encryption-pgp/info.json b/encryption-pgp/info.json index f71d984..671a05c 100644 --- a/encryption-pgp/info.json +++ b/encryption-pgp/info.json @@ -2,8 +2,8 @@ "name": "PGP Encryption", "identifier": "encryption-pgp", "script": "encryption-pgp.qml", - "authors": ["@pbek"], - "version": "0.0.1", + "authors": ["@pbek", "@ClawOfLight"], + "version": "0.0.2", "minAppVersion": "17.05.7", - "description" : "This script will encrypt and decrypt notes with PGP instead of the internal AES-256 encryption.\nDecryption may only work if you don't have to enter a password." + "description" : "This script will encrypt and decrypt notes with PGP instead of the internal AES-256 encryption.\nDecryption may only work if you don't have to enter a password. Find out how to set up gpg-agent on your system." }