aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain-API-Demo/src/org/openintents
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain-API-Demo/src/org/openintents')
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpCallback.aidl (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoCallback.aidl)13
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl)14
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.aidl (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.aidl)6
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.java (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.java)23
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpServiceConnection.java (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoServiceConnection.java)18
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.aidl (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.aidl)6
-rw-r--r--OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.java (renamed from OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.java)20
7 files changed, 51 insertions, 49 deletions
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoCallback.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpCallback.aidl
index 1f910d4c6..e0ac43d22 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoCallback.aidl
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpCallback.aidl
@@ -14,19 +14,18 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
-import org.openintents.crypto.CryptoSignatureResult;
-import org.openintents.crypto.CryptoError;
+import org.openintents.openpgp.OpenPgpSignatureResult;
+import org.openintents.openpgp.OpenPgpError;
-interface ICryptoCallback {
+interface IOpenPgpCallback {
/**
* CryptoSignatureResult is only returned if the Callback was used from decryptAndVerify
*
*/
- oneway void onSuccess(in byte[] outputBytes, in CryptoSignatureResult signatureResult);
+ oneway void onSuccess(in byte[] outputBytes, in OpenPgpSignatureResult signatureResult);
-
- oneway void onError(in CryptoError error);
+ oneway void onError(in OpenPgpError error);
} \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl
index 854ca0b05..1d54ac77f 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/ICryptoService.aidl
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
-import org.openintents.crypto.ICryptoCallback;
+import org.openintents.openpgp.IOpenPgpCallback;
/**
* All methods are oneway, which means they are asynchronous and non-blocking.
* Results are returned to the callback, which has to be implemented on client side.
*/
-interface ICryptoService {
+interface IOpenPgpService {
/**
* Encrypt
@@ -36,7 +36,7 @@ interface ICryptoService {
* @param callback
* Callback where to return results
*/
- oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in ICryptoCallback callback);
+ oneway void encrypt(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in IOpenPgpCallback callback);
/**
* Sign
@@ -48,7 +48,7 @@ interface ICryptoService {
* @param callback
* Callback where to return results
*/
- oneway void sign(in byte[] inputBytes, in boolean asciiArmor, in ICryptoCallback callback);
+ oneway void sign(in byte[] inputBytes, in boolean asciiArmor, in IOpenPgpCallback callback);
/**
* Encrypt and sign
@@ -64,7 +64,7 @@ interface ICryptoService {
* @param callback
* Callback where to return results
*/
- oneway void encryptAndSign(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in ICryptoCallback callback);
+ oneway void encryptAndSign(in byte[] inputBytes, in String[] encryptionUserIds, in boolean asciiArmor, in IOpenPgpCallback callback);
/**
* Decrypts and verifies given input bytes. If no signature is present this method
@@ -75,6 +75,6 @@ interface ICryptoService {
* @param callback
* Callback where to return results
*/
- oneway void decryptAndVerify(in byte[] inputBytes, in ICryptoCallback callback);
+ oneway void decryptAndVerify(in byte[] inputBytes, in IOpenPgpCallback callback);
} \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.aidl
index 7b67c8995..7a6bed1e6 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.aidl
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
-// Declare CryptoError so AIDL can find it and knows that it implements the parcelable protocol.
-parcelable CryptoError; \ No newline at end of file
+// Declare OpenPgpError so AIDL can find it and knows that it implements the parcelable protocol.
+parcelable OpenPgpError; \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.java b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.java
index 265fe2633..66f168d89 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoError.java
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.java
@@ -14,24 +14,27 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
import android.os.Parcel;
import android.os.Parcelable;
-public class CryptoError implements Parcelable {
+public class OpenPgpError implements Parcelable {
+ public static final int ID_NO_OR_WRONG_PASSPHRASE = 1;
+ public static final int ID_NO_USER_IDS = 2;
+
int errorId;
String message;
- public CryptoError() {
+ public OpenPgpError() {
}
- public CryptoError(int errorId, String message) {
+ public OpenPgpError(int errorId, String message) {
this.errorId = errorId;
this.message = message;
}
- public CryptoError(CryptoError b) {
+ public OpenPgpError(OpenPgpError b) {
this.errorId = b.errorId;
this.message = b.message;
}
@@ -61,16 +64,16 @@ public class CryptoError implements Parcelable {
dest.writeString(message);
}
- public static final Creator<CryptoError> CREATOR = new Creator<CryptoError>() {
- public CryptoError createFromParcel(final Parcel source) {
- CryptoError error = new CryptoError();
+ public static final Creator<OpenPgpError> CREATOR = new Creator<OpenPgpError>() {
+ public OpenPgpError createFromParcel(final Parcel source) {
+ OpenPgpError error = new OpenPgpError();
error.errorId = source.readInt();
error.message = source.readString();
return error;
}
- public CryptoError[] newArray(final int size) {
- return new CryptoError[size];
+ public OpenPgpError[] newArray(final int size) {
+ return new OpenPgpError[size];
}
};
}
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoServiceConnection.java b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpServiceConnection.java
index d9e91f772..9f4fec470 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoServiceConnection.java
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpServiceConnection.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
-import org.openintents.crypto.ICryptoService;
+import org.openintents.openpgp.IOpenPgpService;
import android.content.ComponentName;
import android.content.Context;
@@ -25,27 +25,27 @@ import android.content.ServiceConnection;
import android.os.IBinder;
import android.util.Log;
-public class CryptoServiceConnection {
+public class OpenPgpServiceConnection {
private Context mApplicationContext;
- private ICryptoService mService;
+ private IOpenPgpService mService;
private boolean bound;
private String cryptoProviderPackageName;
- private static final String TAG = "CryptoConnection";
+ private static final String TAG = "OpenPgpServiceConnection";
- public CryptoServiceConnection(Context context, String cryptoProviderPackageName) {
+ public OpenPgpServiceConnection(Context context, String cryptoProviderPackageName) {
mApplicationContext = context.getApplicationContext();
this.cryptoProviderPackageName = cryptoProviderPackageName;
}
- public ICryptoService getService() {
+ public IOpenPgpService getService() {
return mService;
}
private ServiceConnection mCryptoServiceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName name, IBinder service) {
- mService = ICryptoService.Stub.asInterface(service);
+ mService = IOpenPgpService.Stub.asInterface(service);
Log.d(TAG, "connected to service");
bound = true;
}
@@ -68,7 +68,7 @@ public class CryptoServiceConnection {
Log.d(TAG, "not bound yet");
Intent serviceIntent = new Intent();
- serviceIntent.setAction("org.openintents.crypto.ICryptoService");
+ serviceIntent.setAction(IOpenPgpService.class.getName());
serviceIntent.setPackage(cryptoProviderPackageName);
mApplicationContext.bindService(serviceIntent, mCryptoServiceConnection,
Context.BIND_AUTO_CREATE);
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.aidl b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.aidl
index 1d39bac70..e246792d0 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.aidl
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
-// Declare CryptoSignatureResult so AIDL can find it and knows that it implements the parcelable protocol.
-parcelable CryptoSignatureResult; \ No newline at end of file
+// Declare OpenPgpSignatureResult so AIDL can find it and knows that it implements the parcelable protocol.
+parcelable OpenPgpSignatureResult; \ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.java b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.java
index d3aaa52d9..d8642664f 100644
--- a/OpenPGP-Keychain-API-Demo/src/org/openintents/crypto/CryptoSignatureResult.java
+++ b/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.java
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-package org.openintents.crypto;
+package org.openintents.openpgp;
import android.os.Parcel;
import android.os.Parcelable;
-public class CryptoSignatureResult implements Parcelable {
+public class OpenPgpSignatureResult implements Parcelable {
String signatureUserId;
boolean signature;
boolean signatureSuccess;
boolean signatureUnknown;
- public CryptoSignatureResult() {
+ public OpenPgpSignatureResult() {
}
- public CryptoSignatureResult(String signatureUserId, boolean signature,
+ public OpenPgpSignatureResult(String signatureUserId, boolean signature,
boolean signatureSuccess, boolean signatureUnknown) {
this.signatureUserId = signatureUserId;
@@ -39,7 +39,7 @@ public class CryptoSignatureResult implements Parcelable {
this.signatureUnknown = signatureUnknown;
}
- public CryptoSignatureResult(CryptoSignatureResult b) {
+ public OpenPgpSignatureResult(OpenPgpSignatureResult b) {
this.signatureUserId = b.signatureUserId;
this.signature = b.signature;
@@ -59,9 +59,9 @@ public class CryptoSignatureResult implements Parcelable {
dest.writeByte((byte) (signatureUnknown ? 1 : 0));
}
- public static final Creator<CryptoSignatureResult> CREATOR = new Creator<CryptoSignatureResult>() {
- public CryptoSignatureResult createFromParcel(final Parcel source) {
- CryptoSignatureResult vr = new CryptoSignatureResult();
+ public static final Creator<OpenPgpSignatureResult> CREATOR = new Creator<OpenPgpSignatureResult>() {
+ public OpenPgpSignatureResult createFromParcel(final Parcel source) {
+ OpenPgpSignatureResult vr = new OpenPgpSignatureResult();
vr.signatureUserId = source.readString();
vr.signature = source.readByte() == 1;
vr.signatureSuccess = source.readByte() == 1;
@@ -69,8 +69,8 @@ public class CryptoSignatureResult implements Parcelable {
return vr;
}
- public CryptoSignatureResult[] newArray(final int size) {
- return new CryptoSignatureResult[size];
+ public OpenPgpSignatureResult[] newArray(final int size) {
+ return new OpenPgpSignatureResult[size];
}
};