aboutsummaryrefslogtreecommitdiff
path: root/src/cryptoidentity.hpp
blob: a5fbb7fe82397a54e55f94e7e5345323931f1342 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef CRYPTOIDENTITIY_HPP
#define CRYPTOIDENTITIY_HPP

#include <QObject>

#include <QSslCertificate>
#include <QSslKey>

//! Cryptographic user identitiy consisting
//! of a key-certificate pair and some user information.
struct CryptoIdentity
{
    QSslCertificate certificate;
    QSslKey private_key;
    QString display_name;

    bool is_persistent = false;

    bool isValid() const {
        return (not this->certificate.isNull()) and (not this->private_key.isNull());
    }
};

#endif // CRYPTOIDENTITIY_HPP