Let convertKeyIdToHex handle short key IDs

If a short key ID is given, then it should only be displayed as such.
This commit is contained in:
Thialfihar 2014-03-20 14:09:35 +01:00
parent 4137fbff5b
commit 16ae9c8999

View File

@ -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);
}