service: support sender address status and list of confirmed user ids to OpenPgpSignatureResult

This commit is contained in:
Vincent Breitmoser
2016-06-02 15:32:45 +02:00
parent 24b92172be
commit 88b0903bf5
7 changed files with 91 additions and 15 deletions

View File

@@ -274,6 +274,27 @@ public class ProviderHelper {
return (CanonicalizedSecretKeyRing) getCanonicalizedKeyRing(queryUri, true);
}
public ArrayList<String> getConfirmedUserIds(long masterKeyId) throws NotFoundException {
Cursor cursor = mContentResolver.query(UserPackets.buildUserIdsUri(masterKeyId),
new String[]{ UserPackets.USER_ID }, UserPackets.VERIFIED + " = " + Certs.VERIFIED_SECRET, null, null
);
if (cursor == null) {
throw new NotFoundException("Key id for requested user ids not found");
}
try {
ArrayList<String> userIds = new ArrayList<>(cursor.getCount());
while (cursor.moveToNext()) {
String userId = cursor.getString(0);
userIds.add(userId);
}
return userIds;
} finally {
cursor.close();
}
}
private KeyRing getCanonicalizedKeyRing(Uri queryUri, boolean secret) throws NotFoundException {
Cursor cursor = mContentResolver.query(queryUri,
new String[]{