comparison ui/certificate.cpp @ 403:7a15a3066f7b

Fill to two characters
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 16 Apr 2014 11:00:18 +0000
parents 1220b741cd51
children 17e1c8f37d72
comparison
equal deleted inserted replaced
402:bae8d4a20ef1 403:7a15a3066f7b
54 54
55 /* Calculate sha1 fingerprint */ 55 /* Calculate sha1 fingerprint */
56 unsigned char sha1sum[20]; 56 unsigned char sha1sum[20];
57 sha1(chain.raw.p, chain.raw.len, sha1sum); 57 sha1(chain.raw.p, chain.raw.len, sha1sum);
58 for (int i=0; i < 20; i++) { 58 for (int i=0; i < 20; i++) {
59 mFingerprint += QString("%1").arg(sha1sum[i], 0, 16); 59 mFingerprint += QString("%1").arg(sha1sum[i], 0, 16).rightJustified(2, '0');
60 if (i != 19) { 60 if (i != 19) {
61 mFingerprint += ":"; 61 mFingerprint += ":";
62 } 62 }
63 mFingerprint = mFingerprint.toUpper(); 63 mFingerprint = mFingerprint.toUpper();
64 } 64 }

http://wald.intevation.org/projects/trustbridge/