- *
- * 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.sufficientlysecure.keychain.integration;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.net.Uri;
-import android.util.Log;
-
-public class KeychainServiceHelper {
-
- private final static String BLOB_URI = "content://org.sufficientlysecure.keychain.provider.apgserviceblobprovider";
-
- private Context context;
-
- public KeychainServiceHelper(Context context) {
- this.context = context;
- }
-
- /**
- * Set up binary data to en/decrypt
- *
- * @param is
- * InputStream to get the data from
- */
- public void setBlob(InputStream is) {
- Log.d(Constants.TAG, "setBlob() called");
- // 1. get the new contentUri
- ContentResolver cr = context.getContentResolver();
- Uri contentUri = cr.insert(Uri.parse(BLOB_URI), new ContentValues());
-
- // 2. insert binary data
- OutputStream os = null;
- try {
- os = cr.openOutputStream(contentUri, "w");
- } catch (Exception e) {
- Log.e(Constants.TAG, "... exception on setBlob", e);
- }
-
- byte[] buffer = new byte[8];
- int len = 0;
- try {
- while ((len = is.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- Log.d(Constants.TAG, "... write finished, now closing");
- os.close();
- } catch (Exception e) {
- Log.e(Constants.TAG, "... error on writing buffer", e);
- }
-
- // mArgs.putString("BLOB", contentUri.toString());
- }
-
- /**
- * Get the binary result
- *
- *
- * This gets your binary result. It only works if you called {@link #setBlob(InputStream)}
- * before.
- *
- * If you did not call encrypt nor decrypt, this will be the same data as you inputed.
- *
- *
- * @return InputStream of the binary data which was en/decrypted
- *
- * @see #setBlob(InputStream)
- * @see #getResult()
- */
- public InputStream getBlobResult() {
- // if (mArgs.containsKey("BLOB")) {
- ContentResolver cr = context.getContentResolver();
- InputStream in = null;
- try {
- // in = cr.openInputStream(Uri.parse(mArgs.getString("BLOB")));
- } catch (Exception e) {
- Log.e(Constants.TAG, "Could not return blob in result", e);
- }
- return in;
- // } else {
- // return null;
- // }
- }
-}
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainUtil.java b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainUtil.java
deleted file mode 100644
index 19d3850d7..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/integration/KeychainUtil.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- * Copyright (C) 2010-2011 K-9 Mail Contributors
- *
- * 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.sufficientlysecure.keychain.integration;
-
-import android.content.Context;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-
-import android.widget.Toast;
-
-public class KeychainUtil {
-
- /**
- * Check whether OpenPGP Keychain is installed and at a high enough version.
- *
- * @param context
- * @return whether a suitable version of APG was found
- */
- public boolean isApgAvailable(Context context) {
- try {
- PackageInfo pi = context.getPackageManager().getPackageInfo(
- Constants.KEYCHAIN_PACKAGE_NAME, 0);
- if (pi.versionCode >= Constants.MIN_REQUIRED_VERSION) {
- return true;
- } else {
- Toast.makeText(
- context,
- "This OpenPGP Keychain version is not supported! Please update to a newer one!",
- Toast.LENGTH_LONG).show();
- }
- } catch (NameNotFoundException e) {
- // not found
- }
-
- return false;
- }
-
- /**
- * Splits userId string into naming part and email part
- *
- * @param userId
- * @return array with naming (0) and email (1)
- */
- public static String[] splitUserId(String userId) {
- String[] output = new String[2];
-
- String chunks[] = userId.split(" <", 2);
- userId = chunks[0];
- if (chunks.length > 1) {
- output[1] = "<" + chunks[1];
- output[1] = output[1].replaceAll("<", "");
- output[1] = output[1].replaceAll(">", "");
- }
- output[0] = userId;
-
- return output;
- }
-}
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainApiService.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainApiService.aidl
deleted file mode 100644
index ac8327b8e..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainApiService.aidl
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service;
-
-import org.sufficientlysecure.keychain.service.handler.IKeychainEncryptHandler;
-import org.sufficientlysecure.keychain.service.handler.IKeychainDecryptHandler;
-import org.sufficientlysecure.keychain.service.handler.IKeychainGetDecryptionKeyIdHandler;
-
-/**
- * All methods are oneway, which means they are asynchronous and non-blocking.
- * Results are returned into given Handler, which has to be implemented on client side.
- */
-interface IKeychainApiService {
-
- /**
- * Encrypt
- *
- * Either inputBytes or inputUri is given, the other should be null.
- *
- * @param inputBytes
- * Byte array you want to encrypt
- * @param inputUri
- * Blob in ContentProvider you want to encrypt
- * @param useAsciiArmor
- * Convert bytes to ascii armored text to guard against encoding problems
- * @param compression
- * Compression: 0x21070001: none, 1: Zip, 2: Zlib, 3: BZip2
- * @param encryptionKeyIds
- * Ids of public keys used for encryption
- * @param symmetricEncryptionAlgorithm
- * 7: AES-128, 8: AES-192, 9: AES-256, 4: Blowfish, 10: Twofish, 3: CAST5,
- * 6: DES, 2: Triple DES, 1: IDEA
- * @param handler
- * Results are returned to this IKeychainEncryptDecryptHandler Handler
- * to onSuccessEncrypt(in byte[] output), after successful encryption
- */
- oneway void encryptAsymmetric(in byte[] inputBytes, in String inputUri, in boolean useAsciiArmor,
- in int compression, in long[] encryptionKeyIds, in int symmetricEncryptionAlgorithm,
- in IKeychainEncryptHandler handler);
-
- /**
- * Same as encryptAsymmetric but using a passphrase for symmetric encryption
- *
- * @param encryptionPassphrase
- * Passphrase for direct symmetric encryption using symmetricEncryptionAlgorithm
- */
- oneway void encryptSymmetric(in byte[] inputBytes, in String inputUri, in boolean useAsciiArmor,
- in int compression, in String encryptionPassphrase, in int symmetricEncryptionAlgorithm,
- in IKeychainEncryptHandler handler);
-
- /**
- * Encrypt and sign
- *
- * Either inputBytes or inputUri is given, the other should be null.
- *
- * @param inputBytes
- * Byte array you want to encrypt
- * @param inputUri
- * Blob in ContentProvider you want to encrypt
- * @param useAsciiArmor
- * Convert bytes to ascii armored text to guard against encoding problems
- * @param compression
- * Compression: 0x21070001: none, 1: Zip, 2: Zlib, 3: BZip2
- * @param encryptionKeyIds
- * Ids of public keys used for encryption
- * @param symmetricEncryptionAlgorithm
- * 7: AES-128, 8: AES-192, 9: AES-256, 4: Blowfish, 10: Twofish, 3: CAST5,
- * 6: DES, 2: Triple DES, 1: IDEA
- * @param signatureKeyId
- * Key id of key to sign with
- * @param signatureHashAlgorithm
- * 1: MD5, 3: RIPEMD-160, 2: SHA-1, 11: SHA-224, 8: SHA-256, 9: SHA-384,
- * 10: SHA-512
- * @param signatureForceV3
- * Force V3 signatures
- * @param signaturePassphrase
- * Passphrase to unlock signature key
- * @param handler
- * Results are returned to this IKeychainEncryptDecryptHandler Handler
- * to onSuccessEncrypt(in byte[] output), after successful encryption and signing
- */
- oneway void encryptAndSignAsymmetric(in byte[] inputBytes, in String inputUri,
- in boolean useAsciiArmor, in int compression, in long[] encryptionKeyIds,
- in int symmetricEncryptionAlgorithm, in long signatureKeyId, in int signatureHashAlgorithm,
- in boolean signatureForceV3, in String signaturePassphrase,
- in IKeychainEncryptHandler handler);
-
- /**
- * Same as encryptAndSignAsymmetric but using a passphrase for symmetric encryption
- *
- * @param encryptionPassphrase
- * Passphrase for direct symmetric encryption using symmetricEncryptionAlgorithm
- */
- oneway void encryptAndSignSymmetric(in byte[] inputBytes, in String inputUri,
- in boolean useAsciiArmor, in int compression, in String encryptionPassphrase,
- in int symmetricEncryptionAlgorithm, in long signatureKeyId, in int signatureHashAlgorithm,
- in boolean signatureForceV3, in String signaturePassphrase,
- in IKeychainEncryptHandler handler);
-
- /**
- * Decrypts and verifies given input bytes. If no signature is present this method
- * will only decrypt.
- *
- * @param inputBytes
- * Byte array you want to decrypt and verify
- * @param inputUri
- * Blob in ContentProvider you want to decrypt and verify
- * @param keyPassphrase
- * Passphrase to unlock secret key for decryption.
- * @param handler
- * Handler where to return results to after successful encryption
- */
- oneway void decryptAndVerifyAsymmetric(in byte[] inputBytes, in String inputUri,
- in String keyPassphrase, in IKeychainDecryptHandler handler);
-
- /**
- * Same as decryptAndVerifyAsymmetric but for symmetric decryption.
- *
- * @param encryptionPassphrase
- * Passphrase to decrypt
- */
- oneway void decryptAndVerifySymmetric(in byte[] inputBytes, in String inputUri,
- in String encryptionPassphrase, in IKeychainDecryptHandler handler);
-
- /**
- *
- */
- oneway void getDecryptionKeyId(in byte[] inputBytes, in String inputUri,
- in IKeychainGetDecryptionKeyIdHandler handler);
-
-
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainKeyService.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainKeyService.aidl
deleted file mode 100644
index ecea2b8ff..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/IKeychainKeyService.aidl
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service;
-
-import org.sufficientlysecure.keychain.service.handler.IKeychainGetKeyringsHandler;
-
-/**
- * All methods are oneway, which means they are asynchronous and non-blocking.
- * Results are returned into given Handler, which has to be implemented on client side.
- */
-interface IKeychainKeyService {
-
- oneway void getPublicKeyRings(in long[] masterKeyIds, in boolean asAsciiArmoredStringArray,
- in IKeychainGetKeyringsHandler handler);
-
- oneway void getSecretKeyRings(in long[] masterKeyIds, in boolean asAsciiArmoredStringArray,
- in IKeychainGetKeyringsHandler handler);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainDecryptHandler.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainDecryptHandler.aidl
deleted file mode 100644
index 31ead701d..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainDecryptHandler.aidl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service.handler;
-
-interface IKeychainDecryptHandler {
-
- oneway void onSuccess(in byte[] outputBytes, in String outputUri, in boolean signature,
- in long signatureKeyId, in String signatureUserId, in boolean signatureSuccess,
- in boolean signatureUnknown);
-
-
- oneway void onException(in int exceptionNumber, in String message);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainEncryptHandler.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainEncryptHandler.aidl
deleted file mode 100644
index 5b21a0613..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainEncryptHandler.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service.handler;
-
-interface IKeychainEncryptHandler {
- /**
- * Either output or streamUri is given. One of them is null
- *
- */
- oneway void onSuccess(in byte[] outputBytes, in String outputUri);
-
-
- oneway void onException(in int exceptionNumber, in String message);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainGetKeyringsHandler.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainGetKeyringsHandler.aidl
deleted file mode 100644
index c3a7d1faf..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainGetKeyringsHandler.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service.handler;
-
-interface IKeychainGetKeyringsHandler {
- /**
- * Either outputBytes or outputString is given. One of them is null
- *
- */
- oneway void onSuccess(in byte[] outputBytes, in List outputString);
-
-
- oneway void onException(in int exceptionNumber, in String message);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainSignHandler.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainSignHandler.aidl
deleted file mode 100644
index 69badab4c..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainSignHandler.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service.handler;
-
-interface IKeychainSignHandler {
- /**
- * Either output or streamUri is given. One of them is null
- *
- */
- oneway void onSuccess(in byte[] outputBytes, in String outputUri);
-
-
- oneway void onException(in int exceptionNumber, in String message);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainVerifyHandler.aidl b/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainVerifyHandler.aidl
deleted file mode 100644
index aaa9a7f6a..000000000
--- a/OpenPGP-Keychain-API-Lib/src/org/sufficientlysecure/keychain/service/handler/IKeychainVerifyHandler.aidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 Dominik Schürmann
- *
- * 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.sufficientlysecure.keychain.service.handler;
-
-interface IKeychainVerifyHandler {
-
- oneway void onSuccess(in boolean signature, in long signatureKeyId,
- in String signatureUserId, in boolean signatureSuccess, in boolean signatureUnknown);
-
-
- oneway void onException(in int exceptionNumber, in String message);
-}
\ No newline at end of file
diff --git a/OpenPGP-Keychain/AndroidManifest.xml b/OpenPGP-Keychain/AndroidManifest.xml
index e81de7807..2adc93b9c 100644
--- a/OpenPGP-Keychain/AndroidManifest.xml
+++ b/OpenPGP-Keychain/AndroidManifest.xml
@@ -413,7 +413,7 @@
android:name="org.sufficientlysecure.keychain.remote_api.RegisteredAppsListActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:exported="false"
- android:label="@string/title_crypto_consumers" />
+ android:label="@string/title_api_registered_apps" />
Create Key
Edit Key
Preferences
- Registered Applications
+ Registered Applications
Key Server Preference
Change Passphrase
Set Passphrase