diff options
author | Ashley Hughes <spirit.returned@gmail.com> | 2014-01-31 11:49:08 +0000 |
---|---|---|
committer | Ashley Hughes <spirit.returned@gmail.com> | 2014-01-31 11:49:08 +0000 |
commit | f7afa0c8200db25feb8415de35ea83585e7cd7ce (patch) | |
tree | 3a5d14c0ac38947a178f3427a6c9f794f7dabe99 | |
parent | 617f117e23765bf0b6d113d40e9c0f323d39a8cf (diff) | |
download | open-keychain-f7afa0c8200db25feb8415de35ea83585e7cd7ce.tar.gz open-keychain-f7afa0c8200db25feb8415de35ea83585e7cd7ce.tar.bz2 open-keychain-f7afa0c8200db25feb8415de35ea83585e7cd7ce.zip |
default keys gen
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index cf11ffa48..85c1177df 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -193,25 +193,21 @@ public class EditKeyActivity extends SherlockFragmentActivity { if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { // get new key from data bundle returned from service Bundle data = message.getData(); - PGPSecretKeyRing masterKeyRing = (PGPSecretKeyRing) PgpConversionHelper - .BytesToPGPKeyRing(data + PGPSecretKeyRing masterKey = (PGPSecretKey) PgpConversionHelper + .BytesToPGPKey(data .getByteArray(KeychainIntentService.RESULT_NEW_KEY)); - PGPSecretKeyRing subKeyRing = (PGPSecretKeyRing) PgpConversionHelper - .BytesToPGPKeyRing(data + PGPSecretKey subKey = (PGPSecretKey) PgpConversionHelper + .BytesToPGPKey(data .getByteArray(KeychainIntentService.RESULT_NEW_KEY2)); // add master key - @SuppressWarnings("unchecked") - Iterator<PGPSecretKey> masterIt = masterKeyRing.getSecretKeys(); - mKeys.add(masterIt.next()); - mKeysUsages.add(Id.choice.usage.sign_only); + mKeys.add(maskterKey); + mKeysUsages.add(Id.choice.usage.sign_only); //TODO: get from key flags // add sub key - @SuppressWarnings("unchecked") - Iterator<PGPSecretKey> subIt = subKeyRing.getSecretKeys(); subIt.next(); // masterkey - mKeys.add(subIt.next()); - mKeysUsages.add(Id.choice.usage.encrypt_only); + mKeys.add(subKey); + mKeysUsages.add(Id.choice.usage.encrypt_only); //TODO: get from key flags buildLayout(); } |