summaryrefslogtreecommitdiffstats
path: root/crypt/hybridcrypt.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypt/hybridcrypt.h')
-rw-r--r--crypt/hybridcrypt.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/crypt/hybridcrypt.h b/crypt/hybridcrypt.h
index 28f5dfb..602844e 100644
--- a/crypt/hybridcrypt.h
+++ b/crypt/hybridcrypt.h
@@ -4,10 +4,11 @@
#include <cstdio>
#include <QByteArray>
+#include <QDataStream>
+#include <QDebug>
#include <QFile>
#include <QString>
#include <QVector>
-#include <QDebug>
#include <openssl/conf.h>
#include <openssl/evp.h>
@@ -96,16 +97,32 @@ private:
bool isCsprngSeeded();
/**
+ * @brief isKeyRsa
+ * Überprüft, ob der Schlüssel vom Typ RSA ist.
+ * @param key Der Schlüssel, der überprüft wird.
+ * @return Gibt wahr zurück, falls Key vom Typ RSA ist, ansonsten flasch.
+ */
+ bool isKeyRsa(EVP_PKEY *key);
+
+ /**
* @brief throwOpenSslException
- * Wirft eine Exception mit dem OpenSSL Fehler.
+ * Wirft eine CryptException mit dem OpenSSL Fehler.
*/
void throwOpenSslException();
/**
- * @brief freeKeyIfNotNull
- * Gibt den Speicher vom Nutzerschlüssel frei, falls er existiert.
+ * @brief throwExceptionIfEvpKeyIsNotRsa
+ * Wirft eine CryptException, falls der Schlüssel nicht RSA ist.
+ * @param key Der Pointer, der auf NULL gesetzt wird, nachdem der Schlüssel abgräumt wurde.
+ */
+ void throwExceptionIfEvpKeyIsNotRsa(EVP_PKEY **key);
+
+ /**
+ * @brief freeEvpKey
+ * Räumt den Schlüssel hinter key ab.
+ * @param key Der Pointer, der auf NULL gesetzt wird.
*/
- void freeKeyIfNotNull();
+ void freeEvpKey(EVP_PKEY **key);
};
#endif // HYBRIDCRYPT_H