Move encrypted/decrypted rows instead of copying
[platform/core/security/key-manager.git] / doc / key-manager_doc.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef __TIZEN_CORE_KEY_MANAGER_DOC_H__
17 #define __TIZEN_CORE_KEY_MANAGER_DOC_H__
18 /**
19  * @ingroup CAPI_SECURITY_FRAMEWORK
20  * @defgroup CAPI_KEY_MANAGER_MODULE Key Manager
21  * @brief    The key manager provides a secure repository protected by a user’s passwords for keys, certificates, and sensitive data of users and/or their APPs. 
22  *           Additionally, the key manager provides secure cryptographic operations for non-exportable keys without revealing key values to clients.
23  *
24  * @section CAPI_KEY_MANAGER_MODULE_OVERVIEW Overview
25  * <table>
26  *   <tr><th>API</th><th>Description</th></tr>
27  *   <tr>
28  *     <td> @ref CAPI_KEY_MANAGER_CLIENT_MODULE</td>
29  *     <td> Provides APIs for accessing the secure repository and additional secure cryptographic operations.</td>
30  *   </tr>
31  *   <tr>
32  *     <td> @ref CAPI_KEY_MANAGER_TYPES_MODULE</td>
33  *     <td> Defines data types used in these APIs and provides utility methods handling them.</td>
34  *   </tr>
35  * </table>
36  *
37  * It provides a secure repository for keys, certificates, and sensitive data of users and/or their APPs which are protected by a user’s passwords.
38  * Additionally, it provides secure cryptographic operations for non-exportable keys without revealing key values to clients.
39  *
40  * @image html capi_key_manager_overview_diagram.png
41  *
42  * The key manager provides 2 types of API.
43  * - secure repository APIs : These APIs provides storing, retrieving, and removing functions for keys, certificates, and data.
44  * - secure crypto APIs : These APIs provides additional cryptographic operations (create asymmetric key pair, sign/verify signature, verify certificate).
45  *
46  * Data Store Policy:
47  *   A client can specify simple access rules when storing a data in Key Manager.
48  *   - Exportable/Non-Exportable:
49  *     Only for data tagged as exportable, Key Manager returns the raw value of the data.
50  *     If data is tagged as non-exportable, Key Manager does not return its raw value. 
51  *     In that case, Key Manager provides secure cryptographic operations for non-exportable keys without revealing key values to clients.
52  *   - Per Key Password:
53  *     All data in Key Manager is protected by a user’s password.
54  *     Besides, a client can encrypt its data using its own password additionally.
55  *     If a client provides a password when storing a data, the data will be encrypted with the password. 
56  *     This password should be provided when get the data from Key Manager.
57  *
58  * User Login/Logout and Data Protection
59  *   - When a user logs in, logs out or changes his/her password, Key Manager should know about it.
60  *     Privileged APPs such as LockScreen APP or Setting APP can notify the key manager using these control APIs.
61  *   - When a user logs in, the key manager decrypts the user's DKEK (with which a user's data file is encrypted) with a user password.
62  *     So during the login period, any client can access its data which is protected by a user's password.
63  *     "user key" in API means DKEK.
64  *   - When a user logs out, the key manager removes the user's DKEK from memory.
65  *     Therefore, clients cannot access any data.
66  *   - When a user changes his/her password, the key manager re-encrypts the user's DKEK with the new password.
67  *
68  * Data Access Control
69  *   - By default, only the owner of a data can access to the data.
70  *   - If the owner grants the access to other applications, those applications can read or delete the data from key-manager DB.
71  *   - When an application is deleted, the data and access control information granted by the application are also removed.
72  *
73  * Alias Format
74  *   - The format of alias is "package_id name".
75  *   - If package_id is not provided by a client, the key-manager will add the package_id of the client to the name internally.
76  *   - The client can specify only its own package id in the alias when storing a key, certificate, or data.
77  *   - A client should specify the package id of the owner in the alias to retrieve a a key, certificate, or data shared by other applications.
78  *   - Aliases are returned as the format of "package_id name" from the key-manager.
79  *
80  */
81
82 #endif /* __TIZEN_CORE_KEY_MANAGER_DOC_H__ */