summaryrefslogtreecommitdiff
path: root/src/components/include/security_manager/crypto_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/include/security_manager/crypto_manager.h')
-rw-r--r--src/components/include/security_manager/crypto_manager.h48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 00c3833e62..9b11a8e4ae 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -30,42 +30,50 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
-#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
-#include <string>
+#include "application_manager/policies/policy_handler_observer.h"
+#include "security_manager/security_manager_settings.h"
/**
* \class security_manager::CryptoManager
* \brief Class factory, producing instances of \ref SSLContext
*
- * \fn security_manager::SSLContext *security_manager::CryptoManager::CreateSSLContext()
+ * \fn security_manager::SSLContext
+ **security_manager::CryptoManager::CreateSSLContext()
* \brief Creates an instance of \ref SSLContext class
*
- * \fn void security_manager::CryptoManager::ReleaseSSLContext(security_manager::SSLContext *context)
+ * \fn void
+ *security_manager::CryptoManager::ReleaseSSLContext(security_manager::SSLContext
+ **context)
* \brief Frees \ref SSLContext instance
*/
namespace security_manager {
class SSLContext;
-enum Mode { CLIENT, SERVER };
-enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2};
-
-class CryptoManager {
+class CryptoManager : public policy::PolicyHandlerObserver {
public:
- virtual bool Init(Mode mode,
- Protocol protocol,
- const std::string &cert_filename,
- const std::string &key_filename,
- const std::string &ciphers_list,
- bool verify_peer) = 0;
- virtual void Finish() = 0;
- virtual SSLContext *CreateSSLContext() = 0;
- virtual void ReleaseSSLContext(SSLContext *context) = 0;
+ /**
+ * @brief Init allows to initialize cryptomanager with certain values.
+ *
+ * @return true in case initialization was succesfull, false otherwise.
+ */
+ virtual bool Init() = 0;
+ virtual SSLContext* CreateSSLContext() = 0;
+ virtual bool OnCertificateUpdated(const std::string& data) = 0;
+ virtual void ReleaseSSLContext(SSLContext* context) = 0;
virtual std::string LastError() const = 0;
- virtual ~CryptoManager() { }
+
+ virtual bool IsCertificateUpdateRequired() const = 0;
+ /**
+ * \brief Crypto manager settings getter
+ * \return pointer to crypto manager settings class
+ */
+ virtual const CryptoManagerSettings& get_settings() const = 0;
+ virtual ~CryptoManager() {}
};
} // namespace security_manager
-#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_