aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
diff options
context:
space:
mode:
authorAshley Hughes <spirit.returned@gmail.com>2014-02-22 10:27:03 +0000
committerAshley Hughes <spirit.returned@gmail.com>2014-02-22 10:27:03 +0000
commit1b25ec5a0c011f5024d5f14f9919645a455e8a41 (patch)
treef819ac3cea715f3c5cfc5f40bbf8673013ccc7ff /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
parentc3c311152ef33a6887909dbbeae40e8d01f96a9d (diff)
parentd1e8acd3027dce6fd34620b67a2d2be1634822cf (diff)
downloadopen-keychain-1b25ec5a0c011f5024d5f14f9919645a455e8a41.tar.gz
open-keychain-1b25ec5a0c011f5024d5f14f9919645a455e8a41.tar.bz2
open-keychain-1b25ec5a0c011f5024d5f14f9919645a455e8a41.zip
master merge
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index 12bc33995..ba931c61a 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -28,6 +28,7 @@ import org.spongycastle.openpgp.PGPPublicKey;
import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.spongycastle.openpgp.PGPSecretKey;
import org.spongycastle.openpgp.PGPSecretKeyRing;
+import org.spongycastle.openpgp.PGPSignature;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
@@ -210,6 +211,13 @@ public class ProviderHelper {
++userIdRank;
}
+ for (PGPSignature certification : new IterableIterator<PGPSignature>(masterKey.getSignaturesOfType(PGPSignature.POSITIVE_CERTIFICATION))) {
+ //TODO: how to do this?? we need to verify the signatures again and again when they are displayed...
+// if (certification.verify
+// operations.add(buildPublicKeyOperations(context, keyRingRowId, key, rank));
+ }
+
+
try {
context.getContentResolver().applyBatch(KeychainContract.CONTENT_AUTHORITY, operations);
} catch (RemoteException e) {
@@ -562,6 +570,26 @@ public class ProviderHelper {
return fingerprint;
}
+ public static String getUserId(Context context, Uri queryUri) {
+ String[] projection = new String[]{UserIds.USER_ID};
+ Cursor cursor = context.getContentResolver().query(queryUri, projection, null, null, null);
+
+ String userId = null;
+ try {
+ if (cursor != null && cursor.moveToFirst()) {
+ int col = cursor.getColumnIndexOrThrow(UserIds.USER_ID);
+
+ userId = cursor.getString(col);
+ }
+ } finally {
+ if (cursor != null) {
+ cursor.close();
+ }
+ }
+
+ return userId;
+ }
+
public static ArrayList<String> getKeyRingsAsArmoredString(Context context, Uri uri,
long[] masterKeyIds) {
ArrayList<String> output = new ArrayList<String>();