From 73acb69208ea3cae0a98786a2352e0dd58c2a445 Mon Sep 17 00:00:00 2001 From: Thialfihar Date: Wed, 14 May 2014 14:19:07 +0200 Subject: [PATCH] Add github, twitter, website info for keybase keys The very point of keybase.io is the identification and proven link to those identities, so it should be nice to have them. The display is a bit basic still, as it just adds them as userIds, I'm sure this can be prettified, perhaps with logos? --- .../keychain/keyimport/KeybaseKeyServer.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java index 57355d808..953cf3cbb 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java @@ -115,6 +115,23 @@ public class KeybaseKeyServer extends KeyServer { ArrayList userIds = new ArrayList(); String name = fullName + " "; userIds.add(name); + try { + userIds.add("github.com/" + JWalk.getString(match, "components", "github", "val")); + } catch (JSONException e) { + // ignore + } + try { + userIds.add("twitter.com/" + JWalk.getString(match, "components", "twitter", "val")); + } catch (JSONException e) { + // ignore + } + try { + JSONArray array = JWalk.getArray(match, "components", "websites"); + JSONObject website = array.getJSONObject(0); + userIds.add(JWalk.getString(website, "val")); + } catch (JSONException e) { + // ignore + } entry.setUserIds(userIds); entry.setPrimaryUserId(name); return entry;