From 16ae9c899949b5443c06226993ca2efc23591e72 Mon Sep 17 00:00:00 2001 From: Thialfihar Date: Thu, 20 Mar 2014 14:09:35 +0100 Subject: [PATCH] Let convertKeyIdToHex handle short key IDs If a short key ID is given, then it should only be displayed as such. --- .../org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java index 5b00d163a..d201a1426 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java @@ -477,6 +477,11 @@ public class PgpKeyHelper { * @return */ public static String convertKeyIdToHex(long keyId) { + long upper = keyId >> 32; + if (upper == 0) { + // this is a short key id + return convertKeyIdToHexShort(keyId); + } return "0x" + convertKeyIdToHex32bit(keyId >> 32) + convertKeyIdToHex32bit(keyId); }