File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ class DynamicEngine : public Engine
5959 * @see Engine::removeFromEnginesList().
6060 */
6161 void removeFromEnginesList () throw (EngineException);
62+
63+ /* *
64+ * Carrega a Engine e seus algoritmos.
65+ * @throw EngineException caso a Engine esteja indisponível ou ocorra erro ao carregá-la.
66+ * @return True se a Engine foi carregada com sucesso, senão False
67+ */
68+ bool load () throw (EngineException);
69+
70+ /* *
71+ * Libera a Engine e seus algoritmos.
72+ * @throw EngineException caso a Engine esteja indisponível.
73+ * @return True se a Engine foi liberada com sucesso, senão False
74+ */
75+ bool release () throw (EngineException);
6276};
6377
6478#endif /* DYNAMICENGINE_H_*/
Original file line number Diff line number Diff line change @@ -102,3 +102,18 @@ void DynamicEngine::removeFromEnginesList() throw (EngineException)
102102 throw EngineException (EngineException::REMOVE_ENGINE_FROM_LIST, " DynamicEngine::removeFromEnginesList" );
103103 }
104104}
105+
106+ bool DynamicEngine::load () throw (EngineException)
107+ {
108+ int rc = ENGINE_init (this ->engine );
109+ rc &= ENGINE_set_default (this ->engine , ENGINE_METHOD_ALL);
110+ OpenSSL_add_all_algorithms ();
111+ return rc;
112+ }
113+
114+ bool DynamicEngine::release () throw (EngineException)
115+ {
116+ int rc = ENGINE_finish (this ->engine );
117+ rc &= ENGINE_free (this ->engine );
118+ return rc;
119+ }
You can’t perform that action at this time.
0 commit comments