Add initial values support - values to feed the shared database on first startup.
[platform/core/security/key-manager.git] / src / manager / service / ckm-logic.h
index 124cfc8..341d23d 100644 (file)
@@ -48,6 +48,7 @@ struct UserData {
 
 class CKMLogic {
 public:
+    static const uid_t SYSTEM_DB_UID;
     class Exception
     {
     public:
@@ -184,6 +185,21 @@ public:
         const Label &accessor_label,
         const PermissionMask permissionMask);
 
+    int setPermissionHelper(
+            const Credentials &cred,
+            const Name &name,
+            const Label &ownerLabel,
+            const Label &accessorLabel,
+            const PermissionMask permissionMask);
+
+    int verifyAndSaveDataHelper(
+        const Credentials &cred,
+        const Name &name,
+        const Label &label,
+        const RawBuffer &data,
+        DataType dataType,
+        const PolicySerializable &policy);
+
 private:
 
     // select private/system database depending on asking uid and owner label.
@@ -205,7 +221,12 @@ private:
 
     int verifyBinaryData(
         DataType dataType,
-        const RawBuffer &input_data) const;
+        RawBuffer &input_data) const;
+
+    int toBinaryData(
+        DataType dataType,
+        const RawBuffer &input_data,
+        RawBuffer &output_data) const;
 
     int checkSaveConditions(
         const Credentials &cred,
@@ -332,13 +353,6 @@ private:
         bool useTrustedSystemCertificates,
         RawBufferVector &chainRawVector);
 
-    int setPermissionHelper(
-        const Credentials &cred,
-        const Name &name,
-        const Label &ownerLabel,
-        const Label &accessorLabel,
-        const PermissionMask permissionMask);
-
     int getDataListHelper(
         const Credentials &cred,
         const DataType dataType,