Merge pull request #469 from honnel/save-key-workaround

Can't save key after key generation
This commit is contained in:
Dominik Schürmann 2014-03-23 00:13:18 +01:00
commit ff67ddc5f4

View File

@ -543,7 +543,15 @@ public class KeychainIntentService extends IntentService
ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId), ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId),
oldPassPhrase, newPassPhrase); oldPassPhrase, newPassPhrase);
} else { } else {
PGPPublicKey pubkey = ProviderHelper.getPGPPublicKeyByKeyId(this, masterKeyId); //TODO: Workaround due to ProviderHelper.getPGPPublicKeyByKeyId can not resolve public key of master-key id with uri/cursor
PGPPublicKey pubkey = null;
for(PGPSecretKey key : keys) {
PGPPublicKey tempKey = key.getPublicKey();
if (tempKey.getKeyID() == masterKeyId) {
pubkey = tempKey;
}
}
//PGPPublicKey pubkey = ProviderHelper.getPGPPublicKeyByKeyId(this, masterKeyId);
keyOperations.buildSecretKey(userIds, keys, keysUsages, keysExpiryDates, keyOperations.buildSecretKey(userIds, keys, keysUsages, keysExpiryDates,
pubkey, oldPassPhrase, newPassPhrase); pubkey, oldPassPhrase, newPassPhrase);
} }