diff ui/certificate.h @ 83:ba8a548ff252

Expand certificate class to make raw data accessible
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Mar 2014 16:20:44 +0000
parents 1f27d6db5ee3
children f1ebab8639dc
line wrap: on
line diff
--- a/ui/certificate.h	Wed Mar 19 18:04:14 2014 +0000
+++ b/ui/certificate.h	Thu Mar 20 16:20:44 2014 +0000
@@ -19,9 +19,14 @@
 class Certificate
 {
 public:
-    /** @brief construct a certificate from an X509 ASN1 encoded byte array.
+    /** @brief construct a certificate from a line of a certificate list.
+     *
+     * The first two characters of the string are expected to be
+     * the command. I: or R:
+     *
+     *  @param[in] b64Line The line from the certificate list.
      **/
-    Certificate(const QByteArray& asn1data);
+    Certificate(const QString& b64Line);
 
     ~Certificate();
 
@@ -34,11 +39,30 @@
      *  for this certificate
      *
      **/
-    const QString& shortDescription() const;
+    const QString& shortDescription() const {return mShortDescription;}
+
+    /** @brief get details for the certificate
+     *
+     * Get the X509 information that is returned by x509_crt_info
+     *
+     **/
+    const QString& details() const {return mDetails;}
+
+    /** @brief get the line from which this certificate was constructed
+     *
+     * The resulting line includes the instruction e.g.
+     *
+     * I:BASE64ENCODEDATA...
+     *
+     **/
+    const QString& base64Line() const {return mBaseLine;}
 
 private:
     bool mValid;
+
+    QString mDetails;
     QString mShortDescription;
+    QString mBaseLine;
 
     x509_crt mX509Cert;
 };

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