Refactor RawBuffer hex dumps
[platform/core/security/key-manager.git] / src / manager / crypto / tz-backend / tz-context.cpp
index 9dcd13f..df421f7 100644 (file)
@@ -32,8 +32,6 @@
 #include <cstdint>
 #include <cstring>
 #include <cassert>
-#include <iomanip>
-#include <sstream>
 #include <unordered_map>
 
 namespace CKM {
@@ -56,16 +54,7 @@ const TEEC_UUID KEY_MANAGER_TA_UUID = KM_TA_UUID;
 //raw to hex string conversion to print persistent storage data ID
 static std::string rawToHexString(const RawBuffer &raw)
 {
-        std::string dump;
-
-        for (auto &e : raw) {
-                char buf[3];
-                snprintf(buf, sizeof(buf), "%02x", (e & 0xff));
-                dump.push_back(buf[0]);
-                dump.push_back(buf[1]);
-        }
-
-        return dump;
+       return hexDump<std::string>(raw);
 }
 
 /*