Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
185:ee37c085b9f7 | 186:2551ad24d3c2 |
---|---|
5 * @brief Class around native certificates. | 5 * @brief Class around native certificates. |
6 * | 6 * |
7 */ | 7 */ |
8 | 8 |
9 #include <QByteArray> | 9 #include <QByteArray> |
10 #include <QMap> | |
10 #include <QString> | 11 #include <QString> |
11 | 12 |
12 #ifdef Q_OS_WIN | 13 #ifdef Q_OS_WIN |
13 #include <windows.h> | 14 #include <windows.h> |
14 #include <wincrypt.h> | 15 #include <wincrypt.h> |
34 * | 35 * |
35 * This description should be used as a short overview | 36 * This description should be used as a short overview |
36 * for this certificate | 37 * for this certificate |
37 * | 38 * |
38 **/ | 39 **/ |
39 const QString& shortDescription() const {return mShortDescription;} | 40 QString shortDescription() const; |
40 | 41 |
41 /** @brief get details for the certificate | 42 /** @brief get details for the certificate |
42 * | 43 * |
43 * Get the X509 information that is returned by x509_crt_info | 44 * Get the X509 information that is returned by x509_crt_info |
44 * | 45 * |
52 * I:BASE64ENCODEDATA... | 53 * I:BASE64ENCODEDATA... |
53 * | 54 * |
54 **/ | 55 **/ |
55 const QString& base64Line() const {return mBaseLine;} | 56 const QString& base64Line() const {return mBaseLine;} |
56 | 57 |
58 /** @brief get a single attribute of the subject | |
59 * | |
60 * Returns a single attribute of the subject such as the | |
61 * common name. | |
62 * | |
63 * @param[in] attr the Attribute name. to get e.g. "CN" | |
64 * | |
65 * @returns the value of the attribute or a null string | |
66 **/ | |
67 QString getSubjectAttr(const QString& attr) const; | |
68 | |
57 private: | 69 private: |
58 bool mValid; | 70 bool mValid; |
59 | 71 |
60 QString mDetails; | 72 QString mDetails; |
61 QString mShortDescription; | |
62 QString mBaseLine; | 73 QString mBaseLine; |
74 QMap <QString, QString> mSubjectAttrs; | |
63 }; | 75 }; |
64 #endif | 76 #endif |