diff options
Diffstat (limited to 'OpenPGP-Keychain-API-Demo/src')
32 files changed, 560 insertions, 0 deletions
diff --git a/OpenPGP-Keychain-API-Demo/src/main/AndroidManifest.xml b/OpenPGP-Keychain-API-Demo/src/main/AndroidManifest.xml new file mode 100644 index 000000000..8b8c43776 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.sufficientlysecure.keychain.demo" + android:versionCode="2" + android:versionName="1.1" > + + <uses-sdk + android:minSdkVersion="8" + android:targetSdkVersion="19" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="OpenPGP Keychain API Demo" > + <activity + android:name=".BaseActivity" + android:label="OpenPGP Keychain API Demo" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity + android:name=".OpenPgpProviderActivity" + android:label="OpenPGP Provider" + android:windowSoftInputMode="stateHidden" /> + <activity + android:name=".AidlDemoActivity2" + android:label="Aidl Demo (ACCESS_KEYS permission)" + android:windowSoftInputMode="stateHidden" /> + </application> + +</manifest>
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpCallback.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpCallback.aidl index ba41de1ba..ba41de1ba 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpCallback.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpCallback.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl index 4ca356fad..4ca356fad 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpService.aidl index 8f9e8a0fd..8f9e8a0fd 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/IOpenPgpService.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/IOpenPgpService.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpData.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpData.aidl index 3711e4fb4..3711e4fb4 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpData.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpData.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpError.aidl index 7a6bed1e6..7a6bed1e6 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpError.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.aidl b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpSignatureResult.aidl index e246792d0..e246792d0 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.aidl +++ b/OpenPGP-Keychain-API-Demo/src/main/aidl/org/openintents/openpgp/OpenPgpSignatureResult.aidl diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpCallback.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpCallback.aidl new file mode 100644 index 000000000..ba41de1ba --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpCallback.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +import org.openintents.openpgp.OpenPgpData; +import org.openintents.openpgp.OpenPgpSignatureResult; +import org.openintents.openpgp.OpenPgpError; + +interface IOpenPgpCallback { + + /** + * onSuccess returns on successful OpenPGP operations. + * + * @param output + * contains resulting output (decrypted content (when input was encrypted) + * or content without signature (when input was signed-only)) + * @param signatureResult + * signatureResult is only non-null if decryptAndVerify() was called and the content + * was encrypted or signed-and-encrypted. + */ + oneway void onSuccess(in OpenPgpData output, in OpenPgpSignatureResult signatureResult); + + /** + * onError returns on errors or when allowUserInteraction was set to false, but user interaction + * was required execute an OpenPGP operation. + * + * @param error + * See OpenPgpError class for more information. + */ + oneway void onError(in OpenPgpError error); +}
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl new file mode 100644 index 000000000..4ca356fad --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpKeyIdsCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +import org.openintents.openpgp.OpenPgpError; + +interface IOpenPgpKeyIdsCallback { + + /** + * onSuccess returns on successful getKeyIds operations. + * + * @param keyIds + * returned key ids + */ + oneway void onSuccess(in long[] keyIds); + + /** + * onError returns on errors or when allowUserInteraction was set to false, but user interaction + * was required execute an OpenPGP operation. + * + * @param error + * See OpenPgpError class for more information. + */ + oneway void onError(in OpenPgpError error); +}
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpService.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpService.aidl new file mode 100644 index 000000000..8f9e8a0fd --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/IOpenPgpService.aidl @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +import org.openintents.openpgp.OpenPgpData; +import org.openintents.openpgp.IOpenPgpCallback; +import org.openintents.openpgp.IOpenPgpKeyIdsCallback; + +/** + * 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 IOpenPgpService { + + /** + * Sign + * + * After successful signing, callback's onSuccess will contain the resulting output. + * + * @param input + * OpenPgpData object containing String, byte[], ParcelFileDescriptor, or Uri + * @param output + * Request output format by defining OpenPgpData object + * + * new OpenPgpData(OpenPgpData.TYPE_STRING) + * Returns as String + * (OpenPGP Radix-64, 33 percent overhead compared to binary, see http://tools.ietf.org/html/rfc4880#page-53) + * new OpenPgpData(OpenPgpData.TYPE_BYTE_ARRAY) + * Returns as byte[] + * new OpenPgpData(uri) + * Writes output to given Uri + * new OpenPgpData(fileDescriptor) + * Writes output to given ParcelFileDescriptor + * @param callback + * Callback where to return results + */ + oneway void sign(in OpenPgpData input, in OpenPgpData output, in IOpenPgpCallback callback); + + /** + * Encrypt + * + * After successful encryption, callback's onSuccess will contain the resulting output. + * + * @param input + * OpenPgpData object containing String, byte[], ParcelFileDescriptor, or Uri + * @param output + * Request output format by defining OpenPgpData object + * + * new OpenPgpData(OpenPgpData.TYPE_STRING) + * Returns as String + * (OpenPGP Radix-64, 33 percent overhead compared to binary, see http://tools.ietf.org/html/rfc4880#page-53) + * new OpenPgpData(OpenPgpData.TYPE_BYTE_ARRAY) + * Returns as byte[] + * new OpenPgpData(uri) + * Writes output to given Uri + * new OpenPgpData(fileDescriptor) + * Writes output to given ParcelFileDescriptor + * @param keyIds + * Key Ids of recipients. Can be retrieved with getKeyIds() + * @param callback + * Callback where to return results + */ + oneway void encrypt(in OpenPgpData input, in OpenPgpData output, in long[] keyIds, in IOpenPgpCallback callback); + + /** + * Sign then encrypt + * + * After successful signing and encryption, callback's onSuccess will contain the resulting output. + * + * @param input + * OpenPgpData object containing String, byte[], ParcelFileDescriptor, or Uri + * @param output + * Request output format by defining OpenPgpData object + * + * new OpenPgpData(OpenPgpData.TYPE_STRING) + * Returns as String + * (OpenPGP Radix-64, 33 percent overhead compared to binary, see http://tools.ietf.org/html/rfc4880#page-53) + * new OpenPgpData(OpenPgpData.TYPE_BYTE_ARRAY) + * Returns as byte[] + * new OpenPgpData(uri) + * Writes output to given Uri + * new OpenPgpData(fileDescriptor) + * Writes output to given ParcelFileDescriptor + * @param keyIds + * Key Ids of recipients. Can be retrieved with getKeyIds() + * @param callback + * Callback where to return results + */ + oneway void signAndEncrypt(in OpenPgpData input, in OpenPgpData output, in long[] keyIds, in IOpenPgpCallback callback); + + /** + * Decrypts and verifies given input bytes. This methods handles encrypted-only, signed-and-encrypted, + * and also signed-only input. + * + * After successful decryption/verification, callback's onSuccess will contain the resulting output. + * The signatureResult in onSuccess is only non-null if signed-and-encrypted or signed-only inputBytes were given. + * + * @param input + * OpenPgpData object containing String, byte[], ParcelFileDescriptor, or Uri + * @param output + * Request output format by defining OpenPgpData object + * + * new OpenPgpData(OpenPgpData.TYPE_STRING) + * Returns as String + * (OpenPGP Radix-64, 33 percent overhead compared to binary, see http://tools.ietf.org/html/rfc4880#page-53) + * new OpenPgpData(OpenPgpData.TYPE_BYTE_ARRAY) + * Returns as byte[] + * new OpenPgpData(uri) + * Writes output to given Uri + * new OpenPgpData(fileDescriptor) + * Writes output to given ParcelFileDescriptor + * @param callback + * Callback where to return results + */ + oneway void decryptAndVerify(in OpenPgpData input, in OpenPgpData output, in IOpenPgpCallback callback); + + /** + * Get available key ids based on given user ids + * + * @param ids + * User Ids (emails) of recipients OR key ids + * @param allowUserInteraction + * Enable user interaction to lookup and import unknown keys + * @param callback + * Callback where to return results (different type than callback in other functions!) + */ + oneway void getKeyIds(in String[] ids, in boolean allowUserInteraction, in IOpenPgpKeyIdsCallback callback); + +}
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpConstants.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpConstants.java index b1ca1bfe6..b1ca1bfe6 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpConstants.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpConstants.java diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpData.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpData.aidl new file mode 100644 index 000000000..3711e4fb4 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpData.aidl @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +// Declare OpenPgpData so AIDL can find it and knows that it implements the parcelable protocol. +parcelable OpenPgpData;
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpData.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpData.java index 6615c2146..6615c2146 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpData.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpData.java diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpError.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpError.aidl new file mode 100644 index 000000000..7a6bed1e6 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpError.aidl @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +// 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/openpgp/OpenPgpError.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpError.java index f108d3169..f108d3169 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpError.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpError.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpHelper.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpHelper.java index 7305c47ce..7305c47ce 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpHelper.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpHelper.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpListPreference.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpListPreference.java index c8e709df9..c8e709df9 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpListPreference.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpListPreference.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpServiceConnection.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpServiceConnection.java index f7ba06aaf..f7ba06aaf 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpServiceConnection.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpServiceConnection.java diff --git a/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.aidl b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.aidl new file mode 100644 index 000000000..e246792d0 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.aidl @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 Dominik Schürmann <dominik@dominikschuermann.de> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openintents.openpgp; + +// 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/openpgp/OpenPgpSignatureResult.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java index 829f8f8cf..829f8f8cf 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/openintents/openpgp/OpenPgpSignatureResult.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/AidlDemoActivity2.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/AidlDemoActivity2.java index b6e211955..b6e211955 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/AidlDemoActivity2.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/AidlDemoActivity2.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/BaseActivity.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/BaseActivity.java index 5b286f208..5b286f208 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/BaseActivity.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/BaseActivity.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/Constants.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/Constants.java index 03e76254c..03e76254c 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/Constants.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/Constants.java diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java index 4a96de5a1..4a96de5a1 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java +++ b/OpenPGP-Keychain-API-Demo/src/main/java/org/sufficientlysecure/keychain/demo/OpenPgpProviderActivity.java diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/drawable-hdpi/ic_launcher.png b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..cf114d7db --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-hdpi/ic_launcher.png diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/drawable-mdpi/ic_launcher.png b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..d55318843 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-mdpi/ic_launcher.png diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xhdpi/ic_launcher.png b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..13ed3d450 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xhdpi/ic_launcher.png diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xxhdpi/ic_launcher.png b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..831c993d4 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/drawable-xxhdpi/ic_launcher.png diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/layout/aidl_demo2.xml b/OpenPGP-Keychain-API-Demo/src/main/res/layout/aidl_demo2.xml new file mode 100644 index 000000000..73abd9b5c --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/layout/aidl_demo2.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" > + + <Button + android:id="@+id/aidl_demo_select_encryption_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="selectEncryptionKeysOnClick" + android:text="Select encryption key(s)" /> + + <EditText + android:id="@+id/aidl_demo_keyrings" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="keyrings output" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <Button + android:id="@+id/aidl_demo_get_keyrings_strings" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="getKeyringsStringsOnClick" + android:text="getKeyrings as Strings" /> + + <Button + android:id="@+id/aidl_demo_get_keyrings_bytes" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="getKeyringsBytesOnClick" + android:text="getKeyringsBytes" /> + </LinearLayout> + +</ScrollView>
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/layout/crypto_provider_demo.xml b/OpenPGP-Keychain-API-Demo/src/main/res/layout/crypto_provider_demo.xml new file mode 100644 index 000000000..9f2a0e6ee --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/layout/crypto_provider_demo.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" > + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Encrypt UserIds (split with ',')" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <EditText + android:id="@+id/crypto_provider_demo_encrypt_user_id" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="dominik@dominikschuermann.de" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Message" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <EditText + android:id="@+id/crypto_provider_demo_message" + android:layout_width="match_parent" + android:layout_height="100dip" + android:scrollHorizontally="true" + android:scrollbars="vertical" + android:text="message" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Ciphertext" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <EditText + android:id="@+id/crypto_provider_demo_ciphertext" + android:layout_width="match_parent" + android:layout_height="100dip" + android:text="ciphertext" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" > + + <Button + android:id="@+id/crypto_provider_demo_encrypt" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:onClick="encryptOnClick" + android:text="Encrypt" /> + + <Button + android:id="@+id/crypto_provider_demo_sign" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:onClick="signOnClick" + android:text="Sign" /> + + <Button + android:id="@+id/crypto_provider_demo_encrypt_and_sign" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:onClick="signAndEncryptOnClick" + android:text="Sign and Encrypt" /> + </LinearLayout> + + <Button + android:id="@+id/crypto_provider_demo_decrypt_and_verify" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="decryptAndVerifyOnClick" + android:text="Decrypt and Verify" /> + +</LinearLayout>
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/layout/intent_demo.xml b/OpenPGP-Keychain-API-Demo/src/main/res/layout/intent_demo.xml new file mode 100644 index 000000000..a765343f9 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/layout/intent_demo.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" > + + <Button + android:id="@+id/Button02" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="encryptOnClick" + android:text="Encrypt" /> + + <Button + android:id="@+id/intent_demo_create_new_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="createNewKeyOnClick" + android:text="Create new key" /> + + <Button + android:id="@+id/intent_demo_select_secret_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="selectSecretKeyOnClick" + android:text="Select secret key" /> + + <Button + android:id="@+id/intent_demo_select_encryption_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="selectEncryptionKeysOnClick" + android:text="Select encryption key(s)" /> + + <EditText + android:id="@+id/intent_demo_message" + android:layout_width="match_parent" + android:layout_height="150dip" + android:text="message" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <EditText + android:id="@+id/intent_demo_ciphertext" + android:layout_width="match_parent" + android:layout_height="150dip" + android:text="ciphertext" + android:textAppearance="@android:style/TextAppearance.Small" /> + + <Button + android:id="@+id/intent_demo_encrypt" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="encryptOnClick" + android:text="Encrypt" /> + + <Button + android:id="@+id/intent_demo_encrypt" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="encryptAndReturnOnClick" + android:text="Encrypt and return result" /> + + <Button + android:id="@+id/intent_demo_decrypt" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="decryptOnClick" + android:text="Decrypt" /> + + <Button + android:id="@+id/intent_demo_decrypt" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="decryptAndReturnOnClick" + android:text="Decrypt and return result" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="APG Data:" /> + + <TextView + android:id="@+id/intent_demo_data" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:minLines="10" /> + </LinearLayout> + +</ScrollView>
\ No newline at end of file diff --git a/OpenPGP-Keychain-API-Demo/src/main/res/xml/base_preference.xml b/OpenPGP-Keychain-API-Demo/src/main/res/xml/base_preference.xml new file mode 100644 index 000000000..5febfad44 --- /dev/null +++ b/OpenPGP-Keychain-API-Demo/src/main/res/xml/base_preference.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > + + <PreferenceCategory android:title="Intent" > + <Preference + android:key="intent_demo" + android:title="Intent Demo" /> + </PreferenceCategory> + <!-- <PreferenceCategory android:title="AIDL" > --> + <!-- <Preference --> + <!-- android:key="aidl_demo2" --> + <!-- android:title="AIDL Demo (ACCESS_KEYS permission)" /> --> + <!-- </PreferenceCategory> --> + <PreferenceCategory android:title="OpenPGP Provider" > + <org.openintents.openpgp.OpenPgpListPreference + android:key="openpgp_provider_list" + android:title="Select OpenPGP Provider!" /> + <Preference + android:key="openpgp_provider_demo" + android:title="OpenPGP Provider" /> + </PreferenceCategory> + +</PreferenceScreen>
\ No newline at end of file |