mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 11:35:07 -05:00
default keys gen
This commit is contained in:
parent
617f117e23
commit
f7afa0c820
@ -193,25 +193,21 @@ public class EditKeyActivity extends SherlockFragmentActivity {
|
|||||||
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
||||||
// get new key from data bundle returned from service
|
// get new key from data bundle returned from service
|
||||||
Bundle data = message.getData();
|
Bundle data = message.getData();
|
||||||
PGPSecretKeyRing masterKeyRing = (PGPSecretKeyRing) PgpConversionHelper
|
PGPSecretKeyRing masterKey = (PGPSecretKey) PgpConversionHelper
|
||||||
.BytesToPGPKeyRing(data
|
.BytesToPGPKey(data
|
||||||
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
||||||
PGPSecretKeyRing subKeyRing = (PGPSecretKeyRing) PgpConversionHelper
|
PGPSecretKey subKey = (PGPSecretKey) PgpConversionHelper
|
||||||
.BytesToPGPKeyRing(data
|
.BytesToPGPKey(data
|
||||||
.getByteArray(KeychainIntentService.RESULT_NEW_KEY2));
|
.getByteArray(KeychainIntentService.RESULT_NEW_KEY2));
|
||||||
|
|
||||||
// add master key
|
// add master key
|
||||||
@SuppressWarnings("unchecked")
|
mKeys.add(maskterKey);
|
||||||
Iterator<PGPSecretKey> masterIt = masterKeyRing.getSecretKeys();
|
mKeysUsages.add(Id.choice.usage.sign_only); //TODO: get from key flags
|
||||||
mKeys.add(masterIt.next());
|
|
||||||
mKeysUsages.add(Id.choice.usage.sign_only);
|
|
||||||
|
|
||||||
// add sub key
|
// add sub key
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Iterator<PGPSecretKey> subIt = subKeyRing.getSecretKeys();
|
|
||||||
subIt.next(); // masterkey
|
subIt.next(); // masterkey
|
||||||
mKeys.add(subIt.next());
|
mKeys.add(subKey);
|
||||||
mKeysUsages.add(Id.choice.usage.encrypt_only);
|
mKeysUsages.add(Id.choice.usage.encrypt_only); //TODO: get from key flags
|
||||||
|
|
||||||
buildLayout();
|
buildLayout();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user