diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-09-09 12:59:53 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-09-09 12:59:53 +0200 |
commit | 5dc693c64c14000a3a03903736d000a45795bcee (patch) | |
tree | fc7653d46740579f73d69558fe2a745f6686cb83 /OpenPGP-Keychain-API-Demo | |
parent | c4bf7c5d1145c3a08211f31633d75c61bbb4bcb1 (diff) | |
download | open-keychain-5dc693c64c14000a3a03903736d000a45795bcee.tar.gz open-keychain-5dc693c64c14000a3a03903736d000a45795bcee.tar.bz2 open-keychain-5dc693c64c14000a3a03903736d000a45795bcee.zip |
Make asciiArmor a parameter, extend advanced app settings
Diffstat (limited to 'OpenPGP-Keychain-API-Demo')
3 files changed, 13 insertions, 18 deletions
diff --git a/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml b/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml index 47a8b6520..0579aa643 100644 --- a/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml +++ b/OpenPGP-Keychain-API-Demo/res/layout/crypto_provider_demo.xml @@ -78,7 +78,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:onClick="decryptOnClick" + android:onClick="decryptAndVerifyOnClick" android:text="Decrypt" /> </LinearLayout> diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl index b74ab642c..45a80dfd3 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl +++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl @@ -34,7 +34,7 @@ interface ICryptoService { * @param callback * Callback where to return results */ - oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds, in ICryptoCallback callback); + oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in ICryptoCallback callback); /** * Sign @@ -44,7 +44,7 @@ interface ICryptoService { * @param callback * Callback where to return results */ - oneway void sign(in byte[] inputBytes, in ICryptoCallback callback); + oneway void sign(in byte[] inputBytes, in boolean asciiArmor, in ICryptoCallback callback); /** * Encrypt and sign @@ -58,7 +58,7 @@ interface ICryptoService { * @param callback * Callback where to return results */ - oneway void encryptAndSign(in byte[] inputBytes, in String[] encryptionUserIds, in ICryptoCallback callback); + oneway void encryptAndSign(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in ICryptoCallback callback); /** * Decrypts and verifies given input bytes. If no signature is present this method @@ -71,10 +71,4 @@ interface ICryptoService { */ oneway void decryptAndVerify(in byte[] inputBytes, in ICryptoCallback callback); - /** - * Opens setup using default parameters - * - */ - oneway void setup(boolean asciiArmor, boolean newKeyring, String newKeyringUserId); - }
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java index db84a1742..f60db04b2 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java +++ b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java @@ -74,7 +74,7 @@ public class CryptoProviderDemoActivity extends Activity { @Override public void onSuccess(final byte[] outputBytes, CryptoSignatureResult signatureResult) throws RemoteException { - Log.d(Constants.TAG, "onEncryptSignSuccess"); + Log.d(Constants.TAG, "encryptCallback"); runOnUiThread(new Runnable() { @@ -92,12 +92,12 @@ public class CryptoProviderDemoActivity extends Activity { }; - final ICryptoCallback.Stub decryptCallback = new ICryptoCallback.Stub() { + final ICryptoCallback.Stub decryptAndVerifyCallback = new ICryptoCallback.Stub() { @Override public void onSuccess(final byte[] outputBytes, final CryptoSignatureResult signatureResult) throws RemoteException { - Log.d(Constants.TAG, "onDecryptVerifySuccess"); + Log.d(Constants.TAG, "decryptAndVerifyCallback"); runOnUiThread(new Runnable() { @@ -136,7 +136,7 @@ public class CryptoProviderDemoActivity extends Activity { try { mCryptoServiceConnection.getService().encrypt(inputBytes, - mEncryptUserIds.getText().toString().split(","), encryptCallback); + mEncryptUserIds.getText().toString().split(","), true, encryptCallback); } catch (RemoteException e) { Log.e(Constants.TAG, "CryptoProviderDemo", e); } @@ -146,7 +146,7 @@ public class CryptoProviderDemoActivity extends Activity { byte[] inputBytes = mMessage.getText().toString().getBytes(); try { - mCryptoServiceConnection.getService().sign(inputBytes, encryptCallback); + mCryptoServiceConnection.getService().sign(inputBytes, true, encryptCallback); } catch (RemoteException e) { Log.e(Constants.TAG, "CryptoProviderDemo", e); } @@ -157,17 +157,18 @@ public class CryptoProviderDemoActivity extends Activity { try { mCryptoServiceConnection.getService().encryptAndSign(inputBytes, - mEncryptUserIds.getText().toString().split(","), encryptCallback); + mEncryptUserIds.getText().toString().split(","), true, encryptCallback); } catch (RemoteException e) { Log.e(Constants.TAG, "CryptoProviderDemo", e); } } - public void decryptOnClick(View view) { + public void decryptAndVerifyOnClick(View view) { byte[] inputBytes = mCiphertext.getText().toString().getBytes(); try { - mCryptoServiceConnection.getService().decryptAndVerify(inputBytes, decryptCallback); + mCryptoServiceConnection.getService().decryptAndVerify(inputBytes, + decryptAndVerifyCallback); } catch (RemoteException e) { Log.e(Constants.TAG, "CryptoProviderDemo", e); } |