fix display of fingerprint in key server query

This commit is contained in:
Dominik Schürmann 2014-02-04 22:28:08 +01:00
parent ecd376961f
commit 9d074b01e9
2 changed files with 15 additions and 6 deletions

View File

@ -120,13 +120,15 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
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) {

View File

@ -50,6 +50,13 @@ import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
import android.text.Html;
/**
* TODO:
* rewrite to use machine readable output.
* <p/>
* 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"));