view ui/certificate.h @ 82:1f27d6db5ee3

Polarssl based certificate handling
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Mar 2014 18:04:14 +0000
parents 1dd8e91972a8
children ba8a548ff252
line wrap: on
line source
#ifndef CERTIFICATE_H
#define CERTIFICATE_H
/**
 * @file certificate.h
 * @brief Class around native certificates.
 *
 */

#include <QByteArray>
#include <QString>

#ifdef Q_OS_WIN
#include <windows.h>
#include <wincrypt.h>
#endif

#include <polarssl/x509_crt.h>

class Certificate
{
public:
    /** @brief construct a certificate from an X509 ASN1 encoded byte array.
     **/
    Certificate(const QByteArray& asn1data);

    ~Certificate();

    /** @brief check if this certificate could be parsed */
    bool isValid() const {return mValid;}

    /** @brief get a short description of the certificate
     *
     *  This description should be used as a short overview
     *  for this certificate
     *
     **/
    const QString& shortDescription() const;

private:
    bool mValid;
    QString mShortDescription;

    x509_crt mX509Cert;
};
#endif

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