CKM::ErrorToString removed from key-manager 91/62391/1
authorKyungwook Tak <k.tak@samsung.com>
Wed, 16 Mar 2016 01:40:34 +0000 (10:40 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Wed, 16 Mar 2016 01:40:34 +0000 (10:40 +0900)
Change-Id: I74d50dfc88b3c2a7196872ca7c4393665e5ef323
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
src/ckm-integration/CMakeLists.txt
src/ckm-integration/group01.cpp
src/ckm-integration/group02.cpp
src/ckm-integration/process-settings/unlock-ckm.cpp
src/ckm/async-api.cpp
src/ckm/cc-mode.cpp
src/ckm/ckm-common.cpp
src/ckm/ckm-common.h
src/ckm/main.cpp

index 9ee8ce4..54bc1a5 100644 (file)
@@ -27,11 +27,12 @@ PKG_CHECK_MODULES(CKMI_DEP
     security-manager
     dbus-1
     vconf
-    REQUIRED)
+)
 
 SET(CKMI_SOURCES_DIR ${PROJECT_SOURCE_DIR}/src/ckm-integration)
 
 SET(CKMI_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/ckm/ckm-common.cpp
     ${CKMI_SOURCES_DIR}/process-settings/change-uid.cpp
     ${CKMI_SOURCES_DIR}/process-settings/create-user.cpp
     ${CKMI_SOURCES_DIR}/process-settings/change-smack.cpp
@@ -43,9 +44,13 @@ SET(CKMI_SOURCES
     ${CKMI_SOURCES_DIR}/main.cpp
 )
 
-INCLUDE_DIRECTORIES(SYSTEM ${CKMI_DEP_INCLUDE_DIRS})
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/common/ )
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/ckm-integration/ )
+INCLUDE_DIRECTORIES(
+    SYSTEM
+    ${CKMI_DEP_INCLUDE_DIRS}
+    ${PROJECT_SOURCE_DIR}/src/common
+    ${PROJECT_SOURCE_DIR}/src/ckm-integration
+    ${PROJECT_SOURCE_DIR}/src/ckm
+)
 
 ADD_EXECUTABLE(${TARGET_CKMI_TESTS} ${CKMI_SOURCES})
 
index c40da84..563a68b 100644 (file)
@@ -20,6 +20,7 @@
  */
 #include <sys/types.h>
 #include <unistd.h>
+#include <ckm-common.h>
 
 #include <dpl/test/test_runner.h>
 #include <dpl/test/test_runner_child.h>
@@ -60,32 +61,32 @@ RUNNER_CHILD_TEST(G01T01_ControlNegative) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->removeUserData(ps.GetUid())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->resetUserPassword(ps.GetUid(),
         "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->resetUserPassword(ps.GetUid(), "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->unlockUserKey(ps.GetUid(), "test-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->lockUserKey(ps.GetUid())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->resetUserPassword(ps.GetUid(), "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = control->removeUserData(ps.GetUid())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(G01T02_ControlPositive) {
@@ -98,32 +99,32 @@ RUNNER_CHILD_TEST(G01T02_ControlPositive) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_UID)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->resetUserPassword(USER_UID,
         "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->resetUserPassword(USER_UID, "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_UID, "test-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_UID)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_BAD_REQUEST == (temp = control->resetUserPassword(USER_UID, "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_UID)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(G01T03_ProcessIdentificationBySecurityManager) {
index 86e0038..5fb68cf 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <sys/types.h>
 #include <unistd.h>
+#include <ckm-common.h>
 
 #include <dpl/test/test_runner.h>
 #include <dpl/test/test_runner_child.h>
@@ -69,11 +70,11 @@ RUNNER_CHILD_TEST(G02T01_StorageNegative) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->saveData(alias, rawBuffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->getData(alias, CKM::Password(), output)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(G02T02_StoragePositive) {
@@ -91,11 +92,11 @@ RUNNER_CHILD_TEST(G02T02_StoragePositive) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(alias, rawBuffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(alias, CKM::Password(), output)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(rawBuffer == output, "Data mismatch.");
 }
@@ -115,11 +116,11 @@ RUNNER_CHILD_TEST(G02T03_StoragePositive) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(dataAlias, rawBuffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(dataAlias, CKM::Password(), output)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(rawBuffer == output, "Data mismatch.");
 }
@@ -145,11 +146,11 @@ RUNNER_CHILD_TEST(G02T04_StorageNegative) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->saveData(alias, rawBuffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->getData(alias, CKM::Password(), output)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(G02T05_StorageNegative) {
@@ -168,10 +169,10 @@ RUNNER_CHILD_TEST(G02T05_StorageNegative) {
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->saveData(alias, rawBuffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->getData(alias, CKM::Password(), output)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
index 59d86d6..78f9a6a 100644 (file)
@@ -20,6 +20,7 @@
  */
 #include <ckm/ckm-control.h>
 
+#include <ckm-common.h>
 #include <tests_common.h>
 
 #include <process-settings/unlock-ckm.h>
@@ -43,7 +44,7 @@ void UnlockCkm::Apply() {
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(m_uid, "DummyPassword")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
 }
 
@@ -52,7 +53,7 @@ void UnlockCkm::Revoke() {
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(m_uid)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 UnlockCkm::~UnlockCkm() {}
index 37472b3..2fde838 100644 (file)
@@ -334,8 +334,8 @@ void test_negative(F&& func, int expected, Args... args)
     RUNNER_ASSERT_MSG(obs->m_finished, "Request is not finished!");
     RUNNER_ASSERT_MSG(
             obs->m_error == expected,
-            "Expected " << expected << "/" << ErrorToString(expected) <<
-            " got: " << obs->m_error << "/" << ErrorToString(obs->m_error));
+            "Expected " << expected << "/" << CKMErrorToString(expected) <<
+            " got: " << obs->m_error << "/" << CKMErrorToString(obs->m_error));
 }
 
 template <typename F, typename... Args>
@@ -355,7 +355,7 @@ MyObserverPtr test_positive(F&& func, Args... args)
 
     RUNNER_ASSERT_MSG(obs->m_finished, "Request is not finished!");
     RUNNER_ASSERT_MSG(obs->m_error == 0,
-                         "Request failed " << obs->m_error << "/" << ErrorToString(obs->m_error));
+                         "Request failed " << obs->m_error << "/" << CKMErrorToString(obs->m_error));
     return obs;
 }
 
index 08395d9..b2b29db 100644 (file)
@@ -121,7 +121,7 @@ void save_keys()
                 rsa_pub_alias,
                 Policy(Password(), true),
                 Policy(Password(), true))),
-            "Error=" << ErrorToString(temp));
+            "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairECDSA(
@@ -130,14 +130,14 @@ void save_keys()
                 ecdsa_pub_alias,
                 Policy(Password(), true),
                 Policy(Password(), true))),
-            "Error=" << ErrorToString(temp));
+            "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyAES(
                 aes_length,
                 aes_alias,
                 Policy(Password(), true))),
-            "Error=" << ErrorToString(temp));
+            "Error=" << CKMErrorToString(temp));
 }
 
 void read_key(ManagerShPtr& manager, const Alias& alias, int expected) {
@@ -145,8 +145,8 @@ void read_key(ManagerShPtr& manager, const Alias& alias, int expected) {
     int temp;
     RUNNER_ASSERT_MSG(
             expected == (temp = manager->getKey(alias, Password(), key)),
-            "Expected: " << expected << "/" << ErrorToString(expected) << " got: " << temp << "/" <<
-            ErrorToString(temp));
+            "Expected: " << expected << "/" << CKMErrorToString(expected) << " got: " << temp << "/" <<
+            CKMErrorToString(temp));
 }
 
 void read_keys(int expected)
@@ -167,7 +167,7 @@ void update_cc_mode()
     auto control = Control::create();
     int ret;
     RUNNER_ASSERT_MSG(CKM_API_SUCCESS == (ret = control->updateCCMode()),
-                         "Error=" << ErrorToString(ret));
+                         "Error=" << CKMErrorToString(ret));
 }
 
 void restart_ckm(const char* const mdpp_setting)
index 47ac15d..4f6880d 100644 (file)
@@ -116,8 +116,8 @@ ScopedLabel::~ScopedLabel()
     change_label(m_original_label.c_str());
 }
 
-const char * CKMCErrorToString(int error) {
 #define ERRORDESCRIBE(name) case name: return #name
+const char * CKMCErrorToString(int error) {
     switch(error) {
         ERRORDESCRIBE(CKMC_ERROR_NONE);
         ERRORDESCRIBE(CKMC_ERROR_INVALID_PARAMETER);
@@ -144,9 +144,38 @@ const char * CKMCErrorToString(int error) {
         ERRORDESCRIBE(CKMC_ERROR_UNKNOWN);
         default: return "Error not defined";
     }
-#undef ERRORDESCRIBE
 }
 
+const char * CKMErrorToString(int error) {
+    switch (error) {
+        ERRORDESCRIBE(CKM_API_SUCCESS);
+        ERRORDESCRIBE(CKM_API_ERROR_SOCKET);
+        ERRORDESCRIBE(CKM_API_ERROR_BAD_REQUEST);
+        ERRORDESCRIBE(CKM_API_ERROR_BAD_RESPONSE);
+        ERRORDESCRIBE(CKM_API_ERROR_SEND_FAILED);
+        ERRORDESCRIBE(CKM_API_ERROR_RECV_FAILED);
+        ERRORDESCRIBE(CKM_API_ERROR_AUTHENTICATION_FAILED);
+        ERRORDESCRIBE(CKM_API_ERROR_INPUT_PARAM);
+        ERRORDESCRIBE(CKM_API_ERROR_BUFFER_TOO_SMALL);
+        ERRORDESCRIBE(CKM_API_ERROR_OUT_OF_MEMORY);
+        ERRORDESCRIBE(CKM_API_ERROR_ACCESS_DENIED);
+        ERRORDESCRIBE(CKM_API_ERROR_SERVER_ERROR);
+        ERRORDESCRIBE(CKM_API_ERROR_DB_LOCKED);
+        ERRORDESCRIBE(CKM_API_ERROR_DB_ERROR);
+        ERRORDESCRIBE(CKM_API_ERROR_DB_ALIAS_EXISTS);
+        ERRORDESCRIBE(CKM_API_ERROR_DB_ALIAS_UNKNOWN);
+        ERRORDESCRIBE(CKM_API_ERROR_VERIFICATION_FAILED);
+        ERRORDESCRIBE(CKM_API_ERROR_INVALID_FORMAT);
+        ERRORDESCRIBE(CKM_API_ERROR_FILE_ACCESS_DENIED);
+        ERRORDESCRIBE(CKM_API_ERROR_NOT_EXPORTABLE);
+        ERRORDESCRIBE(CKM_API_ERROR_FILE_SYSTEM);
+        ERRORDESCRIBE(CKM_API_ERROR_NOT_SUPPORTED);
+        ERRORDESCRIBE(CKM_API_ERROR_UNKNOWN);
+        default: return "Error not defined";
+    }
+}
+#undef ERRORDESCRIBE
+
 std::string CKMCReadableError(int error) {
     std::string output("Error: ");
     output += std::to_string(error);
@@ -359,7 +388,7 @@ void unlock_user_data(uid_t user_id, const char *passwd)
     int ret;
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(CKM_API_SUCCESS == (ret = control->unlockUserKey(user_id, passwd)),
-                      "Error=" << CKM::ErrorToString(ret));
+                      "Error=" << CKMErrorToString(ret));
 }
 
 void remove_user_data(uid_t user_id)
index 7f48951..9bfebe0 100644 (file)
@@ -35,6 +35,7 @@ extern const std::string SMACK_USER_APP_PREFIX;
 
 // support for error printing
 const char * CKMCErrorToString(int error);
+const char * CKMErrorToString(int error);
 std::string CKMCReadableError(int error);
 
 // RUNNER_ASSERT wrappers
index 7a9a1a3..df2de0a 100644 (file)
@@ -79,7 +79,7 @@ RUNNER_TEST(T0011_Control)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP, "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T0012_Control)
@@ -88,10 +88,10 @@ RUNNER_TEST(T0012_Control)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP, "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T0013_Control)
@@ -100,7 +100,7 @@ RUNNER_TEST(T0013_Control)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP, "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T0014_Control)
@@ -109,31 +109,31 @@ RUNNER_TEST(T0014_Control)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_APP_3)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->resetUserPassword(USER_APP_3, "simple-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->resetUserPassword(USER_APP_3, "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP_3, "test-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP_3)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_BAD_REQUEST == (temp = control->resetUserPassword(USER_APP_3, "something")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_APP_3)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T0015_Control)
@@ -142,16 +142,16 @@ RUNNER_TEST(T0015_Control)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP_2, "test-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->changeUserPassword(USER_APP_2, "test-pass", "new-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP_2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_APP_2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T0016_Control_negative_wrong_password)
@@ -160,19 +160,19 @@ RUNNER_TEST(T0016_Control_negative_wrong_password)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP_2, "test-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->changeUserPassword(USER_APP_2, "test-pass", "new-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP_2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = control->unlockUserKey(USER_APP_2, "incorrect-password")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_APP_2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST_GROUP_INIT(T101_CKM_QUICK_SET_GET_TESTS);
@@ -204,10 +204,10 @@ RUNNER_TEST(T1011_key)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKey(alias, CKM::Password(), key2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         key->getDER() == key2->getDER(),
         "Key value has been changed by service");
@@ -224,10 +224,10 @@ RUNNER_TEST(T1012_certificate)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveCertificate(alias, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getCertificate(alias, CKM::Password(), cert2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         cert->getDER() == cert2->getDER(),
         "Data has been modified in key manager");
@@ -258,10 +258,10 @@ RUNNER_CHILD_TEST(T1013_user_app_save_key)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(alias, key, CKM::Policy("x"))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKey(alias, CKM::Password("x"), key2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         key->getDER() == key2->getDER(), "Key value has been changed by service");
 }
@@ -294,12 +294,12 @@ RUNNER_TEST(T1014_save_with_label)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(full_address, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     // lookup by name
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKey(alias, CKM::Password(), key_name)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         key->getDER() == key_name->getDER(),
         "Key value has been changed by service");
@@ -307,7 +307,7 @@ RUNNER_TEST(T1014_save_with_label)
     // lookup by full address
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKey(full_address, CKM::Password(), key_full_addr)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         key->getDER() == key_full_addr->getDER(),
         "Key value has been changed by service");
@@ -327,7 +327,7 @@ RUNNER_TEST(T1020_init)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP, "user-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1021_save_keys_get_alias)
@@ -352,16 +352,16 @@ RUNNER_TEST(T1021_save_keys_get_alias)
     size_t current_aliases_num = count_aliases(ALIAS_KEY);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(sharedDatabase("rootkey1").c_str(), key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(sharedDatabase("rootkey2").c_str(), key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(sharedDatabase("rootkey3").c_str(), key, CKM::Policy(CKM::Password(), false))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKeyAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num+3),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num+3));
@@ -393,16 +393,16 @@ RUNNER_CHILD_TEST(T1022_app_user_save_keys_get_alias)
     size_t current_aliases_num = count_aliases(ALIAS_KEY);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey("appkey1", key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey("appkey2", key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey("appkey3", key, CKM::Policy(CKM::Password(), false))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKeyAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num+3),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num+3));
@@ -434,13 +434,13 @@ RUNNER_CHILD_TEST(T1023_app_user_save_keys_exportable_flag)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey("appkey4", key, notExportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_NOT_EXPORTABLE == (temp = manager->getKey("appkey4", CKM::Password(), key)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveData("data3", buffer, notExportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1029_deinit)
@@ -474,19 +474,19 @@ RUNNER_TEST(T1031_save_get_bin_data)
     size_t current_aliases_num = count_aliases(ALIAS_DATA);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(sharedDatabase("data1").c_str(), buffer1, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(sharedDatabase("data2").c_str(), buffer2, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(sharedDatabase("data3").c_str(), buffer3, CKM::Policy(CKM::Password(), true))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveData(sharedDatabase("data4").c_str(), buffer3, CKM::Policy(CKM::Password(), false))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num+3),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num+3));
@@ -494,14 +494,14 @@ RUNNER_TEST(T1031_save_get_bin_data)
     CKM::RawBuffer buffer;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(sharedDatabase("data2").c_str(), CKM::Password(), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         buffer == buffer2,
         "Data corrupted");
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(sharedDatabase("data2").c_str(), CKM::Password("Password"), buffer)),
-        "The wrong password should be ignored because non was used in saveData. Error=" << CKM::ErrorToString(temp));
+        "The wrong password should be ignored because non was used in saveData. Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T1032_app_user_save_bin_data)
@@ -523,16 +523,16 @@ RUNNER_CHILD_TEST(T1032_app_user_save_bin_data)
     size_t current_aliases_num = count_aliases(ALIAS_DATA);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("appdata1", buffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("appdata2", buffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("appdata3", buffer, CKM::Policy(CKM::Password(), true))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num+3),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num+3));
@@ -552,16 +552,16 @@ RUNNER_TEST(T1033_remove_bin_data)
     std::string invalid_address = sharedDatabase("i-do-not-exist");
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->removeAlias(invalid_address.c_str())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->removeAlias(sharedDatabase("data1").c_str())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->removeAlias(sharedDatabase("data3").c_str())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num-2),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num-2));
@@ -569,13 +569,13 @@ RUNNER_TEST(T1033_remove_bin_data)
     CKM::RawBuffer buffer;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(sharedDatabase("data2").c_str(), CKM::Password(), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         buffer == buffer2,
         "Data corrupted");
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getData(sharedDatabase("data3").c_str(), CKM::Password(), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1034_app_remove_bin_data)
@@ -597,16 +597,16 @@ RUNNER_TEST(T1034_app_remove_bin_data)
     std::string invalid_address = aliasWithLabel("i-do-not-exist", "appdata1");
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->removeAlias(invalid_address.c_str())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->removeAlias("appdata1")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->removeAlias("appdata3")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(labelAliasVector)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         labelAliasVector.size() == (current_aliases_num-2),
         "Wrong size of list: " << labelAliasVector.size() << " Expected: " << (current_aliases_num-2));
@@ -614,13 +614,13 @@ RUNNER_TEST(T1034_app_remove_bin_data)
     CKM::RawBuffer buffer;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData("appdata2", CKM::Password(), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         buffer == buffer2,
         "Data corrupted");
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getData("appdata3", CKM::Password(), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1035_getData_wrong_password)
@@ -634,19 +634,19 @@ RUNNER_TEST(T1035_getData_wrong_password)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData(sharedDatabase("data4").c_str(), buffer1, CKM::Policy("CorrectPassword"))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     CKM::RawBuffer buffer;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getData(sharedDatabase("data4").c_str(), CKM::Password("CorrectPassword"), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         buffer == buffer1,
         "Data corrupted");
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getData(sharedDatabase("data4").c_str(), CKM::Password("WrongPassword"), buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1036_deinit)
@@ -664,7 +664,7 @@ RUNNER_TEST(T1040_init)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->unlockUserKey(USER_APP, "user-pass")),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T1041_create_RSA_key)
@@ -680,10 +680,10 @@ RUNNER_CHILD_TEST(T1041_create_RSA_key)
     size_t current_aliases_num = count_aliases(ALIAS_KEY);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairRSA(2048, CKM::Alias("PRV_KEY1_RSA"), CKM::Alias("PUB_KEY1_RSA"), CKM::Policy(), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKeyAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         (current_aliases_num+2) == static_cast<size_t>(temp = av.size()),
         "Vector size: " << temp << ". Expected: " << (current_aliases_num+2));
@@ -701,10 +701,10 @@ RUNNER_CHILD_TEST(T1042_create_RSA_key_foreign_label)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->createKeyPairRSA(2048, CKM::Alias("iamsomebodyelse PRV_KEY2_RSA"), CKM::Alias("PUB_KEY2_RSA"), CKM::Policy(), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->createKeyPairRSA(2048, CKM::Alias("PRV_KEY2_RSA"), CKM::Alias("iamsomebodyelse PUB_KEY2_RSA"), CKM::Policy(), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T1043_create_DSA_key)
@@ -720,10 +720,10 @@ RUNNER_CHILD_TEST(T1043_create_DSA_key)
     size_t current_aliases_num = count_aliases(ALIAS_KEY);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairDSA(1024, CKM::Alias("PRV_KEY1_DSA"), CKM::Alias("PUB_KEY1_DSA"), CKM::Policy(), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKeyAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         (current_aliases_num+2) == static_cast<size_t>(temp = av.size()),
         "Vector size: " << temp << ". Expected: " << (current_aliases_num+2));
@@ -742,10 +742,10 @@ RUNNER_CHILD_TEST(T1044_create_AES_key)
     int current_aliases_num = count_aliases(ALIAS_KEY);
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyAES(128, CKM::Alias("KEY1_AES"), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getKeyAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         (current_aliases_num+1) == (temp = av.size()),
         "Vector size: " << temp << ". Expected: " << (current_aliases_num+1));
@@ -774,10 +774,10 @@ RUNNER_TEST(T1111_CreateKeyPairRSA)
     CKM::Policy p2;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairRSA(1024, a1, a2, p1, p2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (temp = manager->createKeyPairRSA(1024, a1, a2, p1, p2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1112_CreateKeyPairDSA)
@@ -790,10 +790,10 @@ RUNNER_TEST(T1112_CreateKeyPairDSA)
     CKM::Policy p2;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairDSA(1024, a1, a2, p1, p2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (temp = manager->createKeyPairDSA(1024, a1, a2, p1, p2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1113_CreateKeyPairECDSA)
@@ -806,7 +806,7 @@ RUNNER_TEST(T1113_CreateKeyPairECDSA)
     CKM::Policy p2;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createKeyPairECDSA(CKM::ElipticCurve::prime192v1, a1, a2, p1, p2)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1114_deinit)
@@ -847,10 +847,10 @@ RUNNER_TEST(T12101_key_exist)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 /*
@@ -883,7 +883,7 @@ RUNNER_TEST(T12102_saveKey_empty_alias)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12103_saveKey_foreign_label)
@@ -911,7 +911,7 @@ RUNNER_TEST(T12103_saveKey_foreign_label)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12104_saveKey_empty_key)
@@ -928,7 +928,7 @@ RUNNER_TEST(T12104_saveKey_empty_key)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12105_saveCertificate_empty_alias)
@@ -945,7 +945,7 @@ RUNNER_TEST(T12105_saveCertificate_empty_alias)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveCertificate(alias, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12106_saveCertificate_foreign_label)
@@ -962,7 +962,7 @@ RUNNER_TEST(T12106_saveCertificate_foreign_label)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->saveCertificate(alias, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12107_saveCertificate_empty_cert)
@@ -979,7 +979,7 @@ RUNNER_TEST(T12107_saveCertificate_empty_cert)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveCertificate(alias, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12108_saveData_empty_alias)
@@ -997,7 +997,7 @@ RUNNER_TEST(T12108_saveData_empty_alias)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveData(alias, buffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12109_saveData_foreign_label)
@@ -1015,7 +1015,7 @@ RUNNER_TEST(T12109_saveData_foreign_label)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_ACCESS_DENIED == (temp = manager->saveData(alias, buffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12110_saveData_empty_data)
@@ -1032,7 +1032,7 @@ RUNNER_TEST(T12110_saveData_empty_data)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveData(alias, buffer, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 /*
@@ -1053,7 +1053,7 @@ RUNNER_TEST(T12111_getKey_alias_not_exist)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getKey(alias, "", key)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12112_getCertificate_alias_not_exist)
@@ -1070,7 +1070,7 @@ RUNNER_TEST(T12112_getCertificate_alias_not_exist)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getCertificate(alias, CKM::Password(), certificate)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12113_getData_alias_not_exist)
@@ -1086,7 +1086,7 @@ RUNNER_TEST(T12113_getData_alias_not_exist)
     CKM::Alias alias("some alias");
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getData(alias, "", buffer)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 /*
@@ -1121,7 +1121,7 @@ RUNNER_TEST(T12114_RSA_key_damaged)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12115_RSA_key_too_short)
@@ -1150,7 +1150,7 @@ RUNNER_TEST(T12115_RSA_key_too_short)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12116_DSA_key_too_short)
@@ -1182,7 +1182,7 @@ RUNNER_TEST(T12116_DSA_key_too_short)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12117_AES_key_too_short)
@@ -1198,7 +1198,7 @@ RUNNER_TEST(T12117_AES_key_too_short)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 /*
@@ -1249,7 +1249,7 @@ RUNNER_TEST(T12118_RSA_key_damaged_serviceTest)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (ret = manager->saveKey(alias, key, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(ret));
+        "Error=" << CKMErrorToString(ret));
 }
 
 RUNNER_TEST(T12119_saveCertificate_damaged_serviceTest)
@@ -1295,7 +1295,7 @@ RUNNER_TEST(T12119_saveCertificate_damaged_serviceTest)
     auto manager = CKM::Manager::create();
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_INPUT_PARAM == (temp = manager->saveCertificate(alias, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T12120_deinit)
@@ -1371,14 +1371,14 @@ RUNNER_TEST(T13129_get_chain)
                                        true,
                                        certChain);
     RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
-                         "Error=" << CKM::ErrorToString(tmp));
+                         "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         0 == certChain.size(),
         "Wrong size of certificate chain.");
 
     tmp = manager->getCertificateChain(cert, certVector, EMPTY_CERT_VECTOR, true, certChain);
-    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         3 == certChain.size(),
@@ -1402,7 +1402,7 @@ RUNNER_TEST(T1313_get_chain_with_alias)
 
     tmp = manager->getCertificateChain(cert, aliasVector, EMPTY_ALIAS_VECTOR, true, certChain);
     RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
-                         "Error=" << CKM::ErrorToString(tmp));
+                         "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         0 == certChain.size(),
@@ -1410,12 +1410,12 @@ RUNNER_TEST(T1313_get_chain_with_alias)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->saveCertificate(alias, cert1, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     aliasVector.push_back(alias);
 
     tmp = manager->getCertificateChain(cert, aliasVector, EMPTY_ALIAS_VECTOR, true, certChain);
-    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         3 == certChain.size(),
@@ -1437,14 +1437,14 @@ RUNNER_TEST(T13141_ocsp_check_valid_chain)
 
     tmp = manager->getCertificateChain(cert, EMPTY_CERT_VECTOR, EMPTY_CERT_VECTOR, true, certChain);
     RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
-                         "Error=" << CKM::ErrorToString(tmp));
+                         "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         0 == certChain.size(),
         "Wrong size of certificate chain.");
 
     tmp = manager->getCertificateChain(cert, certVector, EMPTY_CERT_VECTOR, true, certChain);
-    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         3 == certChain.size(),
@@ -1453,7 +1453,7 @@ RUNNER_TEST(T13141_ocsp_check_valid_chain)
     int status;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->ocspCheck(certChain, status)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(CKM_API_OCSP_STATUS_GOOD == status, "Verfication failed");
 }
@@ -1521,7 +1521,7 @@ RUNNER_TEST(T13145_ocsp_check_no_ocsp)
     int status;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->ocspCheck(certVector, status)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(CKM_API_OCSP_STATUS_UNSUPPORTED == status, "Verfication failed");
 }
@@ -1603,10 +1603,10 @@ RUNNER_TEST(T1412_RSA_key_create_verify)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPub, keyPub, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -1616,7 +1616,7 @@ RUNNER_TEST(T1412_RSA_key_create_verify)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1626,7 +1626,7 @@ RUNNER_TEST(T1412_RSA_key_create_verify)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1413_DSA_key_create_verify)
@@ -1678,10 +1678,10 @@ RUNNER_TEST(T1413_DSA_key_create_verify)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPub, keyPub, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -1691,7 +1691,7 @@ RUNNER_TEST(T1413_DSA_key_create_verify)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1701,7 +1701,7 @@ RUNNER_TEST(T1413_DSA_key_create_verify)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 
@@ -1739,10 +1739,10 @@ RUNNER_TEST(T1414_ECDSA_key_create_verify)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPub, keyPub, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -1752,7 +1752,7 @@ RUNNER_TEST(T1414_ECDSA_key_create_verify)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1762,7 +1762,7 @@ RUNNER_TEST(T1414_ECDSA_key_create_verify)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
 
@@ -1776,7 +1776,7 @@ RUNNER_TEST(T1414_ECDSA_key_create_verify)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1415_RSA_key_create_verify_negative)
@@ -1800,7 +1800,7 @@ RUNNER_TEST(T1415_RSA_key_create_verify_negative)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1810,7 +1810,7 @@ RUNNER_TEST(T1415_RSA_key_create_verify_negative)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
     memcpy((void*)signature.data(), "BROKEN", 6);
@@ -1823,7 +1823,7 @@ RUNNER_TEST(T1415_RSA_key_create_verify_negative)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1416_DSA_key_create_verify_negative)
@@ -1847,7 +1847,7 @@ RUNNER_TEST(T1416_DSA_key_create_verify_negative)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1857,7 +1857,7 @@ RUNNER_TEST(T1416_DSA_key_create_verify_negative)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
     memcpy((void*)signature.data(), "BROKEN", 6);
@@ -1870,7 +1870,7 @@ RUNNER_TEST(T1416_DSA_key_create_verify_negative)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1417_RSA_cert_create_verify_signature)
@@ -1931,10 +1931,10 @@ RUNNER_TEST(T1417_RSA_cert_create_verify_signature)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveCertificate(aliasPub, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -1944,7 +1944,7 @@ RUNNER_TEST(T1417_RSA_cert_create_verify_signature)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -1954,7 +1954,7 @@ RUNNER_TEST(T1417_RSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
 
@@ -1968,7 +1968,7 @@ RUNNER_TEST(T1417_RSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1418_DSA_cert_create_verify_signature)
@@ -2028,10 +2028,10 @@ RUNNER_TEST(T1418_DSA_cert_create_verify_signature)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveCertificate(aliasPub, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -2041,7 +2041,7 @@ RUNNER_TEST(T1418_DSA_cert_create_verify_signature)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -2051,7 +2051,7 @@ RUNNER_TEST(T1418_DSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
 
@@ -2065,7 +2065,7 @@ RUNNER_TEST(T1418_DSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1419_ECDSA_cert_create_verify_signature)
@@ -2119,10 +2119,10 @@ RUNNER_TEST(T1419_ECDSA_cert_create_verify_signature)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveCertificate(aliasPub, cert, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->createSignature(
@@ -2132,7 +2132,7 @@ RUNNER_TEST(T1419_ECDSA_cert_create_verify_signature)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -2142,7 +2142,7 @@ RUNNER_TEST(T1419_ECDSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
 
@@ -2156,7 +2156,7 @@ RUNNER_TEST(T1419_ECDSA_cert_create_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1420_deinit)
@@ -2229,10 +2229,10 @@ RUNNER_TEST(T14180_init)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPub, keyPub, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasPrv, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     // Prepare ECDSA Key Pair
     std::string ecprv = "-----BEGIN EC PRIVATE KEY-----\n"
@@ -2259,10 +2259,10 @@ RUNNER_TEST(T14180_init)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasEcPub, ecKeyPub, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(aliasEcPrv, ecKeyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 
@@ -2287,7 +2287,7 @@ RUNNER_TEST(T14181_RSA_create_signatue_nohash)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -2297,7 +2297,7 @@ RUNNER_TEST(T14181_RSA_create_signatue_nohash)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
     memcpy((void*)signature.data(), "BROKEN", 6);
@@ -2310,7 +2310,7 @@ RUNNER_TEST(T14181_RSA_create_signatue_nohash)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T14182_RSA_create_signatue_nohash_nopad)
@@ -2334,7 +2334,7 @@ RUNNER_TEST(T14182_RSA_create_signatue_nohash_nopad)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T14183_RSA_create_signatue_nohash_bigmsg)
@@ -2377,7 +2377,7 @@ RUNNER_TEST(T14183_RSA_create_signatue_nohash_bigmsg)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 
@@ -2402,7 +2402,7 @@ RUNNER_TEST(T14184_ECDSA_create_signatue_nohash)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -2412,7 +2412,7 @@ RUNNER_TEST(T14184_ECDSA_create_signatue_nohash)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(signature.size() > 6, "Signature is too small");
 
@@ -2426,7 +2426,7 @@ RUNNER_TEST(T14184_ECDSA_create_signatue_nohash)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T14185_ECDSA_create_signatue_nohash_bigmsg)
@@ -2456,7 +2456,7 @@ RUNNER_TEST(T14185_ECDSA_create_signatue_nohash_bigmsg)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 
@@ -2506,10 +2506,10 @@ RUNNER_TEST(T1511_insert_data)
         int status2 = manager->saveCertificate(certimAlias, certim, CKM::Policy());
         RUNNER_ASSERT_MSG(
             CKM_API_ERROR_DB_ALIAS_EXISTS == status1,
-            "Certificate should be in database already. Error=" << CKM::ErrorToString(status1));
+            "Certificate should be in database already. Error=" << CKMErrorToString(status1));
         RUNNER_ASSERT_MSG(
             CKM_API_ERROR_DB_ALIAS_EXISTS == status2,
-            "Certificate should be in database already. Error=" << CKM::ErrorToString(status2));
+            "Certificate should be in database already. Error=" << CKMErrorToString(status2));
     }
 }
 
@@ -2544,12 +2544,12 @@ RUNNER_CHILD_TEST(T1702_insert_data)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == status1,
-        "Could not put certificate in datbase. Error=" << CKM::ErrorToString(status1));
+        "Could not put certificate in datbase. Error=" << CKMErrorToString(status1));
 
     CKM::AliasVector av;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getCertificateAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         (current_aliases_num+1) == static_cast<size_t>(temp = av.size()),
         "Vector size: " << temp << ". Expected: " << (current_aliases_num+1));
@@ -2561,7 +2561,7 @@ RUNNER_TEST(T1703_removeApplicationData)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->removeApplicationData("t170-special-label")),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_CHILD_TEST(T1704_data_test)
@@ -2576,7 +2576,7 @@ RUNNER_CHILD_TEST(T1704_data_test)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getCertificateAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         0 == (temp = av.size()),
         "Vector size: " << temp << ". Expected: 0");
@@ -2594,23 +2594,23 @@ RUNNER_TEST(T17101_init)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->lockUserKey(USER_TEST+2)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->removeUserData(USER_TEST+2)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->unlockUserKey(USER_TEST+2, "t1706-special-password")),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->lockUserKey(USER_TEST+3)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->removeUserData(USER_TEST+3)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
          CKM_API_SUCCESS == (tmp = control->unlockUserKey(USER_TEST+3, "t1706-special-password")),
-         "Error=" << CKM::ErrorToString(tmp));
+         "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_CHILD_TEST(T17102_prep_data_01)
@@ -2630,7 +2630,7 @@ RUNNER_CHILD_TEST(T17102_prep_data_01)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("data1", buffer, exportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T17103_prep_data_02)
@@ -2650,7 +2650,7 @@ RUNNER_CHILD_TEST(T17103_prep_data_02)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("data2", buffer, exportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T17104_prep_data_03)
@@ -2670,7 +2670,7 @@ RUNNER_CHILD_TEST(T17104_prep_data_03)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("data3", buffer, exportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_CHILD_TEST(T17105_prep_data_04)
@@ -2690,7 +2690,7 @@ RUNNER_CHILD_TEST(T17105_prep_data_04)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveData("data4", buffer, exportable)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T17106_remove_application)
@@ -2700,10 +2700,10 @@ RUNNER_TEST(T17106_remove_application)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->lockUserKey(USER_TEST+3)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->removeApplicationData("t1706-special-label")),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_CHILD_TEST(T17107_check_data_01)
@@ -2718,7 +2718,7 @@ RUNNER_CHILD_TEST(T17107_check_data_01)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         0 == (temp = av.size()),
         "Vector size: " << temp << ". Expected: 0");
@@ -2736,7 +2736,7 @@ RUNNER_CHILD_TEST(T17108_check_data_02)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         1 == (temp = av.size()),
         "Vector size: " << temp << ". Expected: 1");
@@ -2749,7 +2749,7 @@ RUNNER_TEST(T17109_unlock_user2)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
          CKM_API_SUCCESS == (tmp = control->unlockUserKey(USER_TEST+3, "t1706-special-password")),
-         "Error=" << CKM::ErrorToString(tmp));
+         "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_CHILD_TEST(T17110_check_data_03)
@@ -2764,7 +2764,7 @@ RUNNER_CHILD_TEST(T17110_check_data_03)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         0 == (temp = av.size()),
         "Vector size: " << temp << ". Expected: 0");
@@ -2782,7 +2782,7 @@ RUNNER_CHILD_TEST(T17111_check_data_04)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getDataAliasVector(av)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
     RUNNER_ASSERT_MSG(
         1 == (temp = av.size()),
         "Vector size: " << temp << ". Expected: 1");
@@ -2911,11 +2911,11 @@ RUNNER_TEST(T1804_add_PKCS_collision_with_existing_alias)
     int temp;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(alias_PKCS_collision, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (temp = manager->savePKCS12(alias_PKCS_collision, pkcs, CKM::Policy(), CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1805_add_bundle_with_chain_certificates)
@@ -2955,34 +2955,34 @@ RUNNER_TEST(T1805_add_bundle_with_chain_certificates)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->savePKCS12(alias_PKCS_exportable, pkcs, exportable, exportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (tmp = manager->savePKCS12(alias_PKCS_exportable, pkcs, exportable, exportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->savePKCS12(alias_PKCS_not_exportable, pkcs, notExportable, notExportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_EXISTS == (tmp = manager->savePKCS12(alias_PKCS_not_exportable, pkcs, notExportable, notExportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     // try to lookup key
     CKM::KeyShPtr key_lookup;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->getKey(alias_PKCS_exportable, CKM::Password(), key_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_NOT_EXPORTABLE == (tmp = manager->getKey(alias_PKCS_not_exportable, CKM::Password(), key_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     // try to lookup certificate
     CKM::CertificateShPtr cert_lookup;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->getCertificate(alias_PKCS_exportable, CKM::Password(), cert_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_NOT_EXPORTABLE == (tmp = manager->getCertificate(alias_PKCS_not_exportable, CKM::Password(), cert_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_TEST(T1806_get_PKCS)
@@ -2995,17 +2995,17 @@ RUNNER_TEST(T1806_get_PKCS)
     // fail - no entry
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (temp = manager->getPKCS12(sharedDatabase("i-do-not-exist").c_str(), pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     // fail - not exportable
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_NOT_EXPORTABLE == (temp = manager->getPKCS12(alias_PKCS_not_exportable, pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     // success - exportable
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getPKCS12(alias_PKCS_exportable, pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     auto cert = pkcs->getCertificate();
     RUNNER_ASSERT_MSG(
@@ -3042,7 +3042,7 @@ RUNNER_TEST(T1807_create_and_verify_signature)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -3052,7 +3052,7 @@ RUNNER_TEST(T1807_create_and_verify_signature)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1808_create_signature_on_raw_key_and_verify_on_PKCS)
@@ -3083,7 +3083,7 @@ RUNNER_TEST(T1808_create_signature_on_raw_key_and_verify_on_PKCS)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(alias_PKCS_priv_key_copy, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     CKM::HashAlgorithm hash = CKM::HashAlgorithm::SHA256;
     CKM::RSAPaddingAlgorithm padd = CKM::RSAPaddingAlgorithm::PKCS1;
@@ -3097,7 +3097,7 @@ RUNNER_TEST(T1808_create_signature_on_raw_key_and_verify_on_PKCS)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->verifySignature(
@@ -3107,7 +3107,7 @@ RUNNER_TEST(T1808_create_signature_on_raw_key_and_verify_on_PKCS)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1809_create_signature_on_wrong_key_and_verify_on_PKCS)
@@ -3139,7 +3139,7 @@ RUNNER_TEST(T1809_create_signature_on_wrong_key_and_verify_on_PKCS)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->saveKey(alias_PKCS_priv_key_wrong, keyPrv, CKM::Policy())),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     CKM::HashAlgorithm hash = CKM::HashAlgorithm::SHA256;
     CKM::RSAPaddingAlgorithm padd = CKM::RSAPaddingAlgorithm::PKCS1;
@@ -3153,7 +3153,7 @@ RUNNER_TEST(T1809_create_signature_on_wrong_key_and_verify_on_PKCS)
                                         hash,
                                         padd,
                                         signature)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_VERIFICATION_FAILED == (temp = manager->verifySignature(
@@ -3163,7 +3163,7 @@ RUNNER_TEST(T1809_create_signature_on_wrong_key_and_verify_on_PKCS)
                                         signature,
                                         hash,
                                         padd)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1810_verify_get_certificate_chain)
@@ -3197,7 +3197,7 @@ RUNNER_TEST(T1810_verify_get_certificate_chain)
                                        true,
                                        certChain);
     RUNNER_ASSERT_MSG(CKM_API_ERROR_VERIFICATION_FAILED == tmp,
-                         "Error=" << CKM::ErrorToString(tmp));
+                         "Error=" << CKMErrorToString(tmp));
 
     RUNNER_ASSERT_MSG(
         0 == certChain.size(),
@@ -3206,7 +3206,7 @@ RUNNER_TEST(T1810_verify_get_certificate_chain)
     aliasVector.push_back(alias_PKCS_exportable);
 
     tmp = manager->getCertificateChain(cert, EMPTY_ALIAS_VECTOR, aliasVector, false, certChain);
-    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKM::ErrorToString(tmp));
+    RUNNER_ASSERT_MSG(CKM_API_SUCCESS == tmp, "Error=" << CKMErrorToString(tmp));
 
     // 1(cert) + 1(pkcs12 cert) + 2(pkcs12 chain cert) = 4
     RUNNER_ASSERT_MSG(
@@ -3223,29 +3223,29 @@ RUNNER_TEST(T1811_remove_bundle_with_chain_certificates)
     // remove the whole PKCS12 bundles
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->removeAlias(alias_PKCS_exportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = manager->removeAlias(alias_PKCS_not_exportable)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     // expect lookup fails due to unknown alias
     // try to lookup key
     CKM::KeyShPtr key_lookup;
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (tmp = manager->getKey(alias_PKCS_exportable, CKM::Password(), key_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (tmp = manager->getKey(alias_PKCS_not_exportable, CKM::Password(), key_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 
     // try to lookup certificate
     CKM::CertificateShPtr cert_lookup;
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (tmp = manager->getCertificate(alias_PKCS_exportable, CKM::Password(), cert_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == (tmp = manager->getCertificate(alias_PKCS_not_exportable, CKM::Password(), cert_lookup)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_TEST(T1812_get_pkcs12_password_tests)
@@ -3272,32 +3272,32 @@ RUNNER_TEST(T1812_get_pkcs12_password_tests)
     int temp;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->savePKCS12(alias, pkcs, CKM::Policy(pass1), CKM::Policy(pass2))),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, CKM::Password(), CKM::Password(), pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, pass1, CKM::Password(), pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getPKCS12(alias, CKM::Password(), pass2, pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getPKCS12(alias, pass1, pass2, pkcs)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     CKM::CertificateShPtr cert;
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = manager->getCertificate(alias, pass2, cert)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 
     CKM::CertificateShPtrVector certChain;
     CKM::AliasVector certVect;
@@ -3305,7 +3305,7 @@ RUNNER_TEST(T1812_get_pkcs12_password_tests)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = manager->getCertificateChain(cert, certVect, certVect, true, certChain)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST(T1813_deinit)
@@ -3315,7 +3315,7 @@ RUNNER_TEST(T1813_deinit)
 
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP)),
-        "Error=" << CKM::ErrorToString(temp));
+        "Error=" << CKMErrorToString(temp));
 }
 
 RUNNER_TEST_GROUP_INIT(T190_CKM_EMPTY_STORAGE_TESTS);
@@ -3341,7 +3341,7 @@ RUNNER_TEST(T1902_get_data)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_ALIAS_UNKNOWN == status1,
-        "Could not put certificate in datbase. Error=" << CKM::ErrorToString(status1));
+        "Could not put certificate in datbase. Error=" << CKMErrorToString(status1));
 }
 
 RUNNER_TEST(T1903_lock_database)
@@ -3350,7 +3350,7 @@ RUNNER_TEST(T1903_lock_database)
     auto control = CKM::Control::create();
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (tmp = control->lockUserKey(USER_APP)),
-        "Error=" << CKM::ErrorToString(tmp));
+        "Error=" << CKMErrorToString(tmp));
 }
 
 RUNNER_TEST(T1904_get_data_from_locked_database)
@@ -3366,7 +3366,7 @@ RUNNER_TEST(T1904_get_data_from_locked_database)
 
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_LOCKED == status1,
-        "Could not get key from locked database. Error=" << CKM::ErrorToString(status1));
+        "Could not get key from locked database. Error=" << CKMErrorToString(status1));
 }
 
 RUNNER_TEST(T1905_deinit)