aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain-API-Demo
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2013-09-16 12:16:54 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2013-09-16 12:16:54 +0200
commit4e23cf2edc27903b0fa875dd55c48aafe99b83c7 (patch)
treed2229d6ef5e98c01ee39cd29009242623ca8a5f9 /OpenPGP-Keychain-API-Demo
parent53f33dc3cb331ad111a67f5bb9ee69a1e1f34e79 (diff)
downloadopen-keychain-4e23cf2edc27903b0fa875dd55c48aafe99b83c7.tar.gz
open-keychain-4e23cf2edc27903b0fa875dd55c48aafe99b83c7.tar.bz2
open-keychain-4e23cf2edc27903b0fa875dd55c48aafe99b83c7.zip
API update: boolean to allow/disallow user interaction allow real background pgp operations that will not require user input
Diffstat (limited to 'OpenPGP-Keychain-API-Demo')
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl20
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java14
2 files changed, 23 insertions, 11 deletions
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl
index bc5220985..ca291469c 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl
@@ -33,10 +33,13 @@ interface IOpenPgpService {
* User Ids (emails) of recipients
* @param asciiArmor
* Encode for ASCII (Radix-64, 33 percent overhead compared to binary)
+ * @param allowUserInteraction
+ * Allows the OpenPGP Provider to handle missing keys by showing activities
* @param callback
* Callback where to return results
*/
- oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in IOpenPgpCallback callback);
+ oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds,
+ in boolean asciiArmor, in boolean allowUserInteraction, in IOpenPgpCallback callback);
/**
* Sign
@@ -45,10 +48,13 @@ interface IOpenPgpService {
* Byte array you want to encrypt
* @param asciiArmor
* Encode for ASCII (Radix-64, 33 percent overhead compared to binary)
+ * @param allowUserInteraction
+ * Allows the OpenPGP Provider to handle missing keys by showing activities
* @param callback
* Callback where to return results
*/
- oneway void sign(in byte[] inputBytes, in boolean asciiArmor, in IOpenPgpCallback callback);
+ oneway void sign(in byte[] inputBytes, in boolean asciiArmor, in boolean allowUserInteraction,
+ in IOpenPgpCallback callback);
/**
* Sign then encrypt
@@ -61,10 +67,13 @@ interface IOpenPgpService {
* User Ids (email) of sender
* @param asciiArmor
* Encode for ASCII (Radix-64, 33 percent overhead compared to binary)
+ * @param allowUserInteraction
+ * Allows the OpenPGP Provider to handle missing keys by showing activities
* @param callback
* Callback where to return results
*/
- oneway void signAndEncrypt(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in IOpenPgpCallback callback);
+ oneway void signAndEncrypt(in byte[] inputBytes, in String[] encryptionUserIds,
+ in boolean asciiArmor, in boolean allowUserInteraction, in IOpenPgpCallback callback);
/**
* Decrypts and verifies given input bytes. If no signature is present this method
@@ -72,9 +81,12 @@ interface IOpenPgpService {
*
* @param inputBytes
* Byte array you want to decrypt and verify
+ * @param allowUserInteraction
+ * Allows the OpenPGP Provider to handle missing keys by showing activities
* @param callback
* Callback where to return results
*/
- oneway void decryptAndVerify(in byte[] inputBytes, in IOpenPgpCallback callback);
+ oneway void decryptAndVerify(in byte[] inputBytes, in boolean allowUserInteraction,
+ in IOpenPgpCallback callback);
} \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java
index a5f1072bc..94c68ce5a 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java
+++ b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java
@@ -139,7 +139,7 @@ public class OpenPgpProviderActivity extends Activity {
try {
mCryptoServiceConnection.getService().encrypt(inputBytes,
- mEncryptUserIds.getText().toString().split(","), true, encryptCallback);
+ mEncryptUserIds.getText().toString().split(","), true, true, encryptCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
}
@@ -149,7 +149,7 @@ public class OpenPgpProviderActivity extends Activity {
byte[] inputBytes = mMessage.getText().toString().getBytes();
try {
- mCryptoServiceConnection.getService().sign(inputBytes, true, encryptCallback);
+ mCryptoServiceConnection.getService().sign(inputBytes, true, true, encryptCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
}
@@ -160,7 +160,7 @@ public class OpenPgpProviderActivity extends Activity {
try {
mCryptoServiceConnection.getService().signAndEncrypt(inputBytes,
- mEncryptUserIds.getText().toString().split(","), true, encryptCallback);
+ mEncryptUserIds.getText().toString().split(","), true, true, encryptCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
}
@@ -170,7 +170,7 @@ public class OpenPgpProviderActivity extends Activity {
byte[] inputBytes = mCiphertext.getText().toString().getBytes();
try {
- mCryptoServiceConnection.getService().decryptAndVerify(inputBytes,
+ mCryptoServiceConnection.getService().decryptAndVerify(inputBytes, true,
decryptAndVerifyCallback);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoProviderDemo", e);
@@ -228,8 +228,8 @@ public class OpenPgpProviderActivity extends Activity {
if (!providerList.isEmpty()) {
// add "disable OpenPGP provider"
- providerList.add(0, new OpenPgpProviderElement(null, "Disable OpenPGP Provider", getResources()
- .getDrawable(android.R.drawable.ic_menu_close_clear_cancel)));
+ providerList.add(0, new OpenPgpProviderElement(null, "Disable OpenPGP Provider",
+ getResources().getDrawable(android.R.drawable.ic_menu_close_clear_cancel)));
// Init ArrayAdapter with OpenPGP Providers
ListAdapter adapter = new ArrayAdapter<OpenPgpProviderElement>(this,
@@ -260,7 +260,7 @@ public class OpenPgpProviderActivity extends Activity {
dialog.cancel();
finish();
}
-
+
// bind to service
mCryptoServiceConnection = new OpenPgpServiceConnection(
OpenPgpProviderActivity.this, packageName);