aboutsummaryrefslogtreecommitdiff
path: root/src/cryptoidentity.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-10 21:38:05 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-10 21:38:05 +0200
commitab3e5ad5f25862985c17ba557163a1902b54747f (patch)
treeab91f5b8a245a6b506a00e9b0533b096d0753ea4 /src/cryptoidentity.hpp
parentfeb37f7d6b8730e94821fc6d70fb742ff393517d (diff)
downloadkristall-ab3e5ad5f25862985c17ba557163a1902b54747f.tar.gz
Adds install target to makefile, adds support for transient client certificates.
Diffstat (limited to 'src/cryptoidentity.hpp')
-rw-r--r--src/cryptoidentity.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/cryptoidentity.hpp b/src/cryptoidentity.hpp
new file mode 100644
index 0000000..a5fbb7f
--- /dev/null
+++ b/src/cryptoidentity.hpp
@@ -0,0 +1,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