Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
82:1f27d6db5ee3 | 83:ba8a548ff252 |
---|---|
17 #include <polarssl/x509_crt.h> | 17 #include <polarssl/x509_crt.h> |
18 | 18 |
19 class Certificate | 19 class Certificate |
20 { | 20 { |
21 public: | 21 public: |
22 /** @brief construct a certificate from an X509 ASN1 encoded byte array. | 22 /** @brief construct a certificate from a line of a certificate list. |
23 * | |
24 * The first two characters of the string are expected to be | |
25 * the command. I: or R: | |
26 * | |
27 * @param[in] b64Line The line from the certificate list. | |
23 **/ | 28 **/ |
24 Certificate(const QByteArray& asn1data); | 29 Certificate(const QString& b64Line); |
25 | 30 |
26 ~Certificate(); | 31 ~Certificate(); |
27 | 32 |
28 /** @brief check if this certificate could be parsed */ | 33 /** @brief check if this certificate could be parsed */ |
29 bool isValid() const {return mValid;} | 34 bool isValid() const {return mValid;} |
32 * | 37 * |
33 * This description should be used as a short overview | 38 * This description should be used as a short overview |
34 * for this certificate | 39 * for this certificate |
35 * | 40 * |
36 **/ | 41 **/ |
37 const QString& shortDescription() const; | 42 const QString& shortDescription() const {return mShortDescription;} |
43 | |
44 /** @brief get details for the certificate | |
45 * | |
46 * Get the X509 information that is returned by x509_crt_info | |
47 * | |
48 **/ | |
49 const QString& details() const {return mDetails;} | |
50 | |
51 /** @brief get the line from which this certificate was constructed | |
52 * | |
53 * The resulting line includes the instruction e.g. | |
54 * | |
55 * I:BASE64ENCODEDATA... | |
56 * | |
57 **/ | |
58 const QString& base64Line() const {return mBaseLine;} | |
38 | 59 |
39 private: | 60 private: |
40 bool mValid; | 61 bool mValid; |
62 | |
63 QString mDetails; | |
41 QString mShortDescription; | 64 QString mShortDescription; |
65 QString mBaseLine; | |
42 | 66 |
43 x509_crt mX509Cert; | 67 x509_crt mX509Cert; |
44 }; | 68 }; |
45 #endif | 69 #endif |