diff ui/certificate.h @ 186:2551ad24d3c2

Get subject from the certificate and parse it's attributes
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 26 Mar 2014 12:07:06 +0100
parents f1ebab8639dc
children 9f0865dc8b14
line wrap: on
line diff
--- a/ui/certificate.h	Tue Mar 25 18:03:49 2014 +0000
+++ b/ui/certificate.h	Wed Mar 26 12:07:06 2014 +0100
@@ -7,6 +7,7 @@
  */
 
 #include <QByteArray>
+#include <QMap>
 #include <QString>
 
 #ifdef Q_OS_WIN
@@ -36,7 +37,7 @@
      *  for this certificate
      *
      **/
-    const QString& shortDescription() const {return mShortDescription;}
+    QString shortDescription() const;
 
     /** @brief get details for the certificate
      *
@@ -54,11 +55,22 @@
      **/
     const QString& base64Line() const {return mBaseLine;}
 
+    /** @brief get a single attribute of the subject
+     *
+     * Returns a single attribute of the subject such as the
+     * common name.
+     *
+     * @param[in] attr the Attribute name. to get e.g. "CN"
+     *
+     * @returns the value of the attribute or a null string
+     **/
+    QString getSubjectAttr(const QString& attr) const;
+
 private:
     bool mValid;
 
     QString mDetails;
-    QString mShortDescription;
     QString mBaseLine;
+    QMap <QString, QString> mSubjectAttrs;
 };
 #endif

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