pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfobase.cpp
changeset 30 cc1cea6aabaf
parent 26 aad866c37519
--- a/pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfobase.cpp	Fri Jun 11 14:28:40 2010 +0300
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfobase.cpp	Thu Jun 24 12:46:20 2010 +0300
@@ -71,32 +71,6 @@
 }
 
 // ----------------------------------------------------------------------------
-// UntrustedCertificateInfoBase::formattedFingerprint()
-// ----------------------------------------------------------------------------
-//
-const QString UntrustedCertificateInfoBase::formattedFingerprint() const
-{
-    QString formatted;
-    QByteArray fp = fingerprint();
-
-    QString number;
-    int blockIndex = 0;
-    int count = fp.count();
-    for (int index = 0; index < count; ++index) {
-        if (blockIndex == KCharsPerBlock) {
-            formatted.append(KBlockSeparator);
-            blockIndex = 0;
-        }
-        number.sprintf(KHexNumberFormatTwoDigitsWithLeadingZeroes,
-            static_cast<unsigned char>(fp.at(index)));
-        formatted.append(number);
-        ++blockIndex;
-    }
-
-    return formatted;
-}
-
-// ----------------------------------------------------------------------------
 // UntrustedCertificateInfoBase::serialNumber()
 // ----------------------------------------------------------------------------
 //
@@ -106,26 +80,6 @@
 }
 
 // ----------------------------------------------------------------------------
-// UntrustedCertificateInfoBase::formattedSerialNumber()
-// ----------------------------------------------------------------------------
-//
-const QString UntrustedCertificateInfoBase::formattedSerialNumber() const
-{
-    QString formatted;
-    QByteArray sn = serialNumber();
-
-    QString number;
-    int count = sn.count();
-    for (int index = 0; index < count; ++index) {
-        number.sprintf(KHexNumberFormatSimple,
-            static_cast<unsigned char>(sn.at(index)));
-        formatted.append(number);
-    }
-
-    return formatted;
-}
-
-// ----------------------------------------------------------------------------
 // UntrustedCertificateInfoBase::validFrom()
 // ----------------------------------------------------------------------------
 //
@@ -154,7 +108,7 @@
         case X509Certificate:
             //: Type name for X509 certificates displayed in certificate details.
             // TODO: localised UI string
-            format = tr("X509");
+            format = tr("X.509");
             break;
         default:
             //: Type name for unknown certificates displayed in certificate details.
@@ -201,6 +155,52 @@
 }
 
 // ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::formattedFingerprint()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::formattedFingerprint(
+    const QByteArray &byteArray) const
+{
+    QString formatted;
+
+    QString number;
+    int blockIndex = 0;
+    int count = byteArray.count();
+    for (int index = 0; index < count; ++index) {
+        if (blockIndex == KCharsPerBlock) {
+            formatted.append(KBlockSeparator);
+            blockIndex = 0;
+        }
+        number.sprintf(KHexNumberFormatTwoDigitsWithLeadingZeroes,
+            static_cast<unsigned char>(byteArray.at(index)));
+        formatted.append(number);
+        ++blockIndex;
+    }
+
+    return formatted;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::formattedSerialNumber()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::formattedSerialNumber(
+    const QByteArray &serialNumber) const
+{
+    QString formatted;
+
+    QString number;
+    int count = serialNumber.count();
+    for (int index = 0; index < count; ++index) {
+        number.sprintf(KHexNumberFormatSimple,
+            static_cast<unsigned char>(serialNumber.at(index)));
+        formatted.append(number);
+    }
+
+    return formatted;
+}
+
+// ----------------------------------------------------------------------------
 // UntrustedCertificateInfoBase::isDateValid()
 // ----------------------------------------------------------------------------
 //