fixed length identifiers

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

View File

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

View File

@@ -41,9 +41,8 @@ public class DnsResource extends LinkedCookieResource {
public static String generateText (Context context, byte[] fingerprint, int nonce) {
return "pgpid+cookie="
+ KeyFormattingUtils.convertFingerprintToHex(fingerprint) + ";"
+ Integer.toHexString(nonce) + "";
return String.format("pgpid+cookie=%s;%08x",
KeyFormattingUtils.convertFingerprintToHex(fingerprint), nonce);
}