From 0764b73f6a61160ad6765f17073110d8236b68d1 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 14 Sep 2015 14:45:26 +0200 Subject: Importiere nur RSA Schlüssel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crypt/hybridcrypt.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'crypt/hybridcrypt.h') 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 #include +#include +#include #include #include #include -#include #include #include @@ -95,17 +96,33 @@ 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 -- cgit v1.2.3-70-g09d2