diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-04 23:16:58 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-04 23:16:58 +0200 |
commit | 2b436b9a1980a03e253345238fdcd92d1bdcba15 (patch) | |
tree | b0f30c32a2186e5deea17d7fa0063358a7f4dc01 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp | |
parent | bad8aeea781bad8db11d8d2df9cfc7ca579f6adc (diff) | |
parent | fbf993e6211d03308d62a3edf270f9d5a8783fb2 (diff) | |
download | open-keychain-2b436b9a1980a03e253345238fdcd92d1bdcba15.tar.gz open-keychain-2b436b9a1980a03e253345238fdcd92d1bdcba15.tar.bz2 open-keychain-2b436b9a1980a03e253345238fdcd92d1bdcba15.zip |
Merge branch 'jacobshack-certify' of github.com:open-keychain/open-keychain into jacobshack-certify
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java index c3320ed6a..964c535dd 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java @@ -120,10 +120,12 @@ public class PgpImportExport { // If there aren't even any keys, do nothing here. if (entries == null || !entries.hasNext()) { return new ImportKeyResult( - ImportKeyResult.RESULT_FAIL_NOTHING, mProviderHelper.getLog(), 0, 0, 0, 0); + ImportKeyResult.RESULT_FAIL_NOTHING, mProviderHelper.getLog(), 0, 0, 0, 0, + new long[]{}); } int newKeys = 0, oldKeys = 0, badKeys = 0, secret = 0; + ArrayList<Long> importedMasterKeyIds = new ArrayList<Long>(); int position = 0; double progSteps = 100.0 / num; @@ -165,11 +167,13 @@ public class PgpImportExport { badKeys += 1; } else if (result.updated()) { oldKeys += 1; + importedMasterKeyIds.add(key.getMasterKeyId()); } else { newKeys += 1; if (key.isSecret()) { secret += 1; } + importedMasterKeyIds.add(key.getMasterKeyId()); } } catch (IOException e) { @@ -210,8 +214,14 @@ public class PgpImportExport { resultType |= ImportKeyResult.RESULT_CANCELLED; } - return new ImportKeyResult(resultType, log, newKeys, oldKeys, badKeys, secret); + // convert to long array + long[] importedMasterKeyIdsArray = new long[importedMasterKeyIds.size()]; + for (int i = 0; i < importedMasterKeyIds.size(); ++i) { + importedMasterKeyIdsArray[i] = importedMasterKeyIds.get(i); + } + return new ImportKeyResult(resultType, log, newKeys, oldKeys, badKeys, secret, + importedMasterKeyIdsArray); } public Bundle exportKeyRings(ArrayList<Long> publicKeyRingMasterIds, |