aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-06 23:17:42 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-06 23:17:42 +0200
commit074b6633b015aba84f8f60a05878a93d4b8ec9b2 (patch)
treeb7d11a8df2bc0ff93b245fbc67d7c7ba6bf9dd18 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java
parent7cfc0d80d0b4318ce1ae027536d70c2cda4c8605 (diff)
downloadopen-keychain-074b6633b015aba84f8f60a05878a93d4b8ec9b2.tar.gz
open-keychain-074b6633b015aba84f8f60a05878a93d4b8ec9b2.tar.bz2
open-keychain-074b6633b015aba84f8f60a05878a93d4b8ec9b2.zip
eventbus: initial attempt, replace messenger hack with eventbus communication
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java89
1 files changed, 1 insertions, 88 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java
index b8cb9de27..e4bfd7dee 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java
@@ -30,6 +30,7 @@ import android.os.RemoteException;
import com.textuality.keybase.lib.Proof;
import com.textuality.keybase.lib.prover.Prover;
+import de.greenrobot.event.EventBus;
import org.json.JSONObject;
import org.spongycastle.openpgp.PGPUtil;
import org.sufficientlysecure.keychain.Constants;
@@ -96,14 +97,9 @@ public class KeychainService extends Service implements Progressable {
public static final String EXTRA_DATA = "data";
/* possible actions */
- public static final String ACTION_SIGN_ENCRYPT = Constants.INTENT_PREFIX + "SIGN_ENCRYPT";
-
- public static final String ACTION_DECRYPT_VERIFY = Constants.INTENT_PREFIX + "DECRYPT_VERIFY";
public static final String ACTION_VERIFY_KEYBASE_PROOF = Constants.INTENT_PREFIX + "VERIFY_KEYBASE_PROOF";
- public static final String ACTION_DECRYPT_METADATA = Constants.INTENT_PREFIX + "DECRYPT_METADATA";
-
public static final String ACTION_EDIT_KEYRING = Constants.INTENT_PREFIX + "EDIT_KEYRING";
public static final String ACTION_PROMOTE_KEYRING = Constants.INTENT_PREFIX + "PROMOTE_KEYRING";
@@ -113,8 +109,6 @@ public class KeychainService extends Service implements Progressable {
public static final String ACTION_UPLOAD_KEYRING = Constants.INTENT_PREFIX + "UPLOAD_KEYRING";
- public static final String ACTION_CERTIFY_KEYRING = Constants.INTENT_PREFIX + "SIGN_KEYRING";
-
public static final String ACTION_DELETE = Constants.INTENT_PREFIX + "DELETE";
public static final String ACTION_CONSOLIDATE = Constants.INTENT_PREFIX + "CONSOLIDATE";
@@ -123,14 +117,6 @@ public class KeychainService extends Service implements Progressable {
/* keys for data bundle */
- // encrypt
- public static final String ENCRYPT_DECRYPT_INPUT_URI = "input_uri";
- public static final String ENCRYPT_DECRYPT_OUTPUT_URI = "output_uri";
- public static final String SIGN_ENCRYPT_PARCEL = "sign_encrypt_parcel";
-
- // decrypt/verify
- public static final String DECRYPT_VERIFY_PARCEL = "decrypt_verify_parcel";
-
// keybase proof
public static final String KEYBASE_REQUIRED_FINGERPRINT = "keybase_required_fingerprint";
public static final String KEYBASE_PROOF = "keybase_proof";
@@ -158,9 +144,6 @@ public class KeychainService extends Service implements Progressable {
// upload key
public static final String UPLOAD_KEY_SERVER = "upload_key_server";
- // certify key
- public static final String CERTIFY_PARCEL = "certify_parcel";
-
// promote key
public static final String PROMOTE_MASTER_KEY_ID = "promote_master_key_id";
public static final String PROMOTE_CARD_AID = "promote_card_aid";
@@ -232,23 +215,6 @@ public class KeychainService extends Service implements Progressable {
// executeServiceMethod action from extra bundle
switch (action) {
- case ACTION_CERTIFY_KEYRING: {
-
- // Input
- CertifyActionsParcel parcel = data.getParcelable(CERTIFY_PARCEL);
- CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT);
- String keyServerUri = data.getString(UPLOAD_KEY_SERVER);
-
- // Operation
- CertifyOperation op = new CertifyOperation(mKeychainService, providerHelper, mKeychainService,
- mActionCanceled);
- CertifyResult result = op.certify(parcel, cryptoInput, keyServerUri);
-
- // Result
- sendMessageToHandler(MessageStatus.OKAY, result);
-
- break;
- }
case ACTION_CONSOLIDATE: {
// Operation
@@ -264,24 +230,6 @@ public class KeychainService extends Service implements Progressable {
break;
}
- case ACTION_DECRYPT_METADATA: {
-
- // Input
- CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT);
- PgpDecryptVerifyInputParcel input = data.getParcelable(DECRYPT_VERIFY_PARCEL);
-
- // this action is here for compatibility only
- input.setDecryptMetadataOnly(true);
-
- // Operation
- PgpDecryptVerify op = new PgpDecryptVerify(mKeychainService, providerHelper, mKeychainService);
- DecryptVerifyResult decryptVerifyResult = op.execute(input, cryptoInput);
-
- // Result
- sendMessageToHandler(MessageStatus.OKAY, decryptVerifyResult);
-
- break;
- }
case ACTION_VERIFY_KEYBASE_PROOF: {
try {
@@ -376,25 +324,6 @@ public class KeychainService extends Service implements Progressable {
break;
}
- case ACTION_DECRYPT_VERIFY: {
-
- // Input
- CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT);
- PgpDecryptVerifyInputParcel input = data.getParcelable(DECRYPT_VERIFY_PARCEL);
-
- // for compatibility
- // TODO merge with ACTION_DECRYPT_METADATA
- input.setDecryptMetadataOnly(false);
-
- // Operation
- PgpDecryptVerify op = new PgpDecryptVerify(mKeychainService, providerHelper, mKeychainService);
- DecryptVerifyResult decryptVerifyResult = op.execute(input, cryptoInput);
-
- // Output
- sendMessageToHandler(MessageStatus.OKAY, decryptVerifyResult);
-
- break;
- }
case ACTION_DELETE: {
// Input
@@ -495,22 +424,6 @@ public class KeychainService extends Service implements Progressable {
break;
}
- case ACTION_SIGN_ENCRYPT: {
-
- // Input
- SignEncryptParcel inputParcel = data.getParcelable(SIGN_ENCRYPT_PARCEL);
- CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT);
-
- // Operation
- SignEncryptOperation op = new SignEncryptOperation(
- mKeychainService, providerHelper, mKeychainService, mActionCanceled);
- SignEncryptResult result = op.execute(inputParcel, cryptoInput);
-
- // Result
- sendMessageToHandler(MessageStatus.OKAY, result);
-
- break;
- }
case ACTION_UPLOAD_KEYRING: {
try {