diff options
author | Thialfihar <thi@thialfihar.org> | 2014-03-20 14:09:35 +0100 |
---|---|---|
committer | Thialfihar <thi@thialfihar.org> | 2014-03-20 14:19:33 +0100 |
commit | 16ae9c899949b5443c06226993ca2efc23591e72 (patch) | |
tree | b06d80dc4bedb098e228e3f9bee203f01efd050f /OpenPGP-Keychain/src/main | |
parent | 4137fbff5b18fe817e53eeca9d2fa474548b6150 (diff) | |
download | open-keychain-16ae9c899949b5443c06226993ca2efc23591e72.tar.gz open-keychain-16ae9c899949b5443c06226993ca2efc23591e72.tar.bz2 open-keychain-16ae9c899949b5443c06226993ca2efc23591e72.zip |
Let convertKeyIdToHex handle short key IDs
If a short key ID is given, then it should only be displayed as such.
Diffstat (limited to 'OpenPGP-Keychain/src/main')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |