changeset 380:1220b741cd51

Add some more fields for a certificate
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 15 Apr 2014 12:45:20 +0200
parents 2ddc685cba33
children 73bfc9cc22e7 7e0a188d6848
files ui/certificate.cpp ui/certificate.h ui/certificatetablemodel.cpp
diffstat 3 files changed, 23 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ui/certificate.cpp	Tue Apr 15 12:39:27 2014 +0200
+++ b/ui/certificate.cpp	Tue Apr 15 12:45:20 2014 +0200
@@ -46,8 +46,10 @@
                                chain.valid_to.sec));
 
     mSubjectCN = getX509Value(&(chain.subject), CERT_OID_CN);
+    mIssuerCN = getX509Value(&(chain.issuer), CERT_OID_CN);
     mSubjectOU = getX509Value(&(chain.subject), CERT_OID_OU);
     mSubjectO = getX509Value(&(chain.subject), CERT_OID_O);
+    mIssuerO = getX509Value(&(chain.issuer), CERT_OID_O);
     mSubjectSN = getX509Value(&(chain.subject), CERT_OID_SN);
 
     /* Calculate sha1 fingerprint */
--- a/ui/certificate.h	Tue Apr 15 12:39:27 2014 +0200
+++ b/ui/certificate.h	Tue Apr 15 12:45:20 2014 +0200
@@ -107,6 +107,12 @@
     /** @brief get the date the certificate expires */
     QDateTime validTo() const {return mValidTo;}
 
+    /** @brief get the issuer CN from the certificate */
+    QString issuerCN() const {return mIssuerCN;}
+
+    /** @brief get the issuer Organization from the certificate */
+    QString issuerO() const {return mIssuerO;}
+
     /** @brief get sha1 sum of the certificate */
     QString fingerprint() const {return mFingerprint;}
 
@@ -136,7 +142,9 @@
             mSubjectSN,
             mDetails,
             mBaseLine,
-            mFingerprint;
+            mFingerprint,
+            mIssuerO,
+            mIssuerCN;
 
     QDateTime mValidFrom,
               mValidTo;
--- a/ui/certificatetablemodel.cpp	Tue Apr 15 12:39:27 2014 +0200
+++ b/ui/certificatetablemodel.cpp	Tue Apr 15 12:45:20 2014 +0200
@@ -4,9 +4,12 @@
     : QAbstractTableModel(parent)
 {
     header.append("");
-    header.append(tr("CN"));
-    header.append(tr("issued  on"));
-    header.append(tr("expires on"));
+    header.append(tr("Subject CN"));
+    header.append(tr("Subject O"));
+    header.append(tr("Issuer CN"));
+    header.append(tr("Issuer O"));
+    header.append(tr("valid from"));
+    header.append(tr("valid to"));
     header.append(tr("SHA1 Fingerprint"));
 
 }
@@ -49,9 +52,12 @@
         switch(index.column()) {
         case 0: ret = cert.isInstallCert(); break;
         case 1: ret = cert.subjectCN(); break;
-        case 2: ret = cert.validFrom(); break;
-        case 3: ret = cert.validTo(); break;
-        case 4: ret = cert.fingerprint(); break;
+        case 2: ret = cert.subjectO(); break;
+        case 3: ret = cert.issuerCN(); break;
+        case 4: ret = cert.issuerO(); break;
+        case 5: ret = cert.validFrom(); break;
+        case 6: ret = cert.validTo(); break;
+        case 7: ret = cert.fingerprint(); break;
         default: ;
         }
         return ret;

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