#ifndef GRADIDO_LOGIN_SERVER_CONTROLLER_CRYPTO_KEY_INCLUDE #define GRADIDO_LOGIN_SERVER_CONTROLLER_CRYPTO_KEY_INCLUDE #include "../model/table/CryptoKey.h" #include "../Crypto/KeyPairHedera.h" #include "Poco/SharedPtr.h" #include "TableControllerBase.h" #include "User.h" namespace controller { class CryptoKey : public TableControllerBase { public: ~CryptoKey(); static Poco::AutoPtr create(const KeyPairHedera* hederaKeyPair, Poco::AutoPtr user); //! if returned ptr is NULL, dataset not found static Poco::AutoPtr load(int id); static Poco::AutoPtr load(MemoryBin* publicKey); static Poco::AutoPtr load(const unsigned char* publicKey, size_t size); inline bool deleteFromDB() { return mDBModel->deleteFromDB(); } inline Poco::AutoPtr getModel() { return _getModel(); } KeyPairHedera* getKeyPair(Poco::AutoPtr user); protected: CryptoKey(model::table::CryptoKey* dbModel); }; } #endif //GRADIDO_LOGIN_SERVER_CONTROLLER_CRYPTO_KEY_INCLUDE