comparison ui/certificate.h @ 21:dc1e1e9e62ce

Add certificate class and use it
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Feb 2014 10:58:28 +0000
parents
children 2f5db8c70bc2
comparison
equal deleted inserted replaced
20:fec1a610d43f 21:dc1e1e9e62ce
1 #ifndef CERTIFICATE_H
2 #define CERTIFICATE_H
3 /**
4 * @file certificate.h
5 * @brief Class around native certificates.
6 *
7 */
8
9 #include <QByteArray>
10 #include <QString>
11
12 #ifdef Q_OS_WIN
13 #include <windows.h>
14 #include <wincrypt.h>
15 #endif
16
17 class Certificate
18 {
19 public:
20 /** @brief construct a certificate from an X509 ASN1 encoded byte array.
21 **/
22 Certificate(const QByteArray& asn1data);
23
24 ~Certificate();
25
26 /** @brief check if this certificate could be parsed */
27 bool isValid() {return mValid;}
28
29 /** @brief get a short description of the certificate
30 *
31 * This description should be used as a short overview
32 * for this certificate
33 *
34 **/
35 QString shortDescription();
36
37 private:
38 bool mValid;
39 QString mShortDescription;
40
41 #ifdef Q_OS_WIN
42 PCCERT_CONTEXT mPCertContext;
43 #endif
44 };
45 #endif

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