2 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Bumjin Im <bj.im@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
19 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 * @author Zofia Abramowska (z.abramowska@samsung.com)
22 * @brief List of all protocols supported by Central Key Manager.
25 #include <protocols.h>
27 #include <dpl/serialization.h>
31 char const * const SERVICE_SOCKET_ECHO = "/tmp/.central-key-manager-echo.sock";
32 char const * const SERVICE_SOCKET_CKM_CONTROL = "/tmp/.central-key-manager-api-control.sock";
33 char const * const SERVICE_SOCKET_CKM_STORAGE = "/tmp/.central-key-manager-api-storage.sock";
34 char const * const SERVICE_SOCKET_OCSP = "/tmp/.central-key-manager-api-ocsp.sock";
35 char const * const LABEL_NAME_SEPARATOR = " ";
38 const char* const DB_PERM_READ = "R";
39 const char* const DB_PERM_READ_REMOVE = "RD";
42 const char* toDBPermission(Permission access_right_type) {
43 switch(access_right_type) {
44 case Permission::READ: return DB_PERM_READ;
45 case Permission::READ_REMOVE: return DB_PERM_READ_REMOVE;
52 Permission toPermission(const std::string &input_DB_data) {
53 if(input_DB_data == DB_PERM_READ_REMOVE)
54 return Permission::READ_REMOVE;
55 else if(input_DB_data == DB_PERM_READ)
56 return Permission::READ;
58 return Permission::NONE;