fixed length identifiers

This commit is contained in:
Vincent Breitmoser committed 2015-03-05 02:10:44 +01:00
1 parent 1f324be243
commit 9798ef7bfd
2 files changed
+4 -7

No files matched your search

@@ -66,10 +66,8 @@ public abstract class LinkedCookieResource extends LinkedResource {
} }
public static String generate (Context context, byte[] fingerprint, int nonce) { public static String generate (Context context, byte[] fingerprint, int nonce) {
return String.format("\"[Verifying my PGP key: openpgp4fpr:%s#%08x]\"",
return "[Verifying my PGP key: openpgp4fpr:" KeyFormattingUtils.convertFingerprintToHex(fingerprint), nonce);
+ KeyFormattingUtils.convertFingerprintToHex(fingerprint) + "#" + Integer.toHexString(nonce) + "]";
} }
public static String generatePreview () { public static String generatePreview () {
@@ -41,9 +41,8 @@ public class DnsResource extends LinkedCookieResource {
public static String generateText (Context context, byte[] fingerprint, int nonce) { public static String generateText (Context context, byte[] fingerprint, int nonce) {
return "pgpid+cookie=" return String.format("pgpid+cookie=%s;%08x",
+ KeyFormattingUtils.convertFingerprintToHex(fingerprint) + ";" KeyFormattingUtils.convertFingerprintToHex(fingerprint), nonce);
+ Integer.toHexString(nonce) + "";
} }