diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index 02a5fea9c..52186b662 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -120,13 +120,15 @@ public class ImportKeysAdapter extends ArrayAdapter { mainUserIdRest.setVisibility(View.GONE); } - // TODO: need to set no key? - keyId.setText(R.string.no_key); keyId.setText(entry.hexKeyId); - fingerprint.setText(mActivity.getString(R.string.fingerprint) + " " + entry.fingerPrint); - // TODO: no need to set algorithm empty... - algorithm.setText(""); + if (entry.fingerPrint != null) { + fingerprint.setText(mActivity.getString(R.string.fingerprint) + " " + entry.fingerPrint); + fingerprint.setVisibility(View.VISIBLE); + } else { + fingerprint.setVisibility(View.GONE); + } + algorithm.setText("" + entry.bitStrength + "/" + entry.algorithm); if (entry.revoked) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index 05e52fb47..61fe13ffb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -50,6 +50,13 @@ import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; import android.text.Html; +/** + * TODO: + * rewrite to use machine readable output. + *

+ * see http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5 + * https://github.com/openpgp-keychain/openpgp-keychain/issues/259 + */ public class HkpKeyServer extends KeyServer { private static class HttpError extends Exception { private static final long serialVersionUID = 1718783705229428893L; @@ -181,8 +188,8 @@ public class HkpKeyServer extends KeyServer { ImportKeysListEntry info = new ImportKeysListEntry(); info.bitStrength = Integer.parseInt(matcher.group(1)); info.algorithm = matcher.group(2); + info.hexKeyId = "0x" + matcher.group(3); info.keyId = PgpKeyHelper.convertHexToKeyId(matcher.group(3)); - info.fingerPrint = PgpKeyHelper.convertKeyIdToHex(info.keyId); String chunks[] = matcher.group(4).split("-"); GregorianCalendar tmpGreg = new GregorianCalendar(TimeZone.getTimeZone("UTC"));