diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-16 00:41:57 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-16 00:41:57 +0200 |
| commit | 33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c (patch) | |
| tree | a724f0c3dcc48c8ce1f78c2665fe8ef170acb379 /src/ssltrust.hpp | |
| parent | 5bb3f3f92e62a0af02fe475943759b8c25cd4592 (diff) | |
| download | kristall-33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c.tar.gz | |
Adds improved client certificate management, adds server certificate management.
Diffstat (limited to 'src/ssltrust.hpp')
| -rw-r--r-- | src/ssltrust.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ssltrust.hpp b/src/ssltrust.hpp new file mode 100644 index 0000000..62d4985 --- /dev/null +++ b/src/ssltrust.hpp @@ -0,0 +1,37 @@ +#ifndef SSLTRUST_HPP +#define SSLTRUST_HPP + +#include <QSslCertificate> +#include <QSslKey> +#include <QSettings> + +#include "trustedhostcollection.hpp" + +struct SslTrust +{ + enum TrustLevel { + TrustOnFirstUse = 0, // default + TrustEverything = 1, // not recommended + TrustNoOne = 2, // approve every fingerprint by hand + }; + + SslTrust() = default; + SslTrust(SslTrust const &) = default; + SslTrust(SslTrust &&) = default; + + SslTrust & operator=(SslTrust const &) = default; + SslTrust & operator=(SslTrust &&) = default; + + TrustLevel trust_level = TrustOnFirstUse; + + TrustedHostCollection trusted_hosts; + + bool enable_ca = false; + + void load(QSettings & settings); + void save(QSettings & settings) const; + + bool isTrusted(QUrl const & url, QSslCertificate const & certificate); +}; + +#endif // SSLTRUST_HPP |
