Call import & destroy on store
[platform/core/security/key-manager.git] / src / manager / service / db-row.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 /*
17  * @file        db-row.h
18  * @author      Zofia Abramowska (z.abramowska@samsung.com)
19  * @version     1.0
20  * @brief       OBJECT_TABLE entry enhanced with corresponding NAME_TABLE identifier
21  */
22 #pragma once
23
24 #include <vector>
25 #include <ckm/ckm-type.h>
26 #include <protocols.h>
27 #include <token.h>
28
29 namespace CKM {
30 namespace DB {
31
32 struct Row : public Token {
33     Row() = default;
34
35     Row(Token token,
36         const Name &pName,
37         const Label &pLabel,
38         int pExportable) :
39         Token(std::move(token))
40       , name(pName)
41       , ownerLabel(pLabel)
42       , exportable(pExportable)
43       , algorithmType(DBCMAlgType::NONE)
44       , encryptionScheme(0)
45       , dataSize(data.size())
46     {}
47
48     Name name;
49     Label ownerLabel;
50     int exportable;
51     DBCMAlgType algorithmType;  // Algorithm type used for row data encryption
52     int encryptionScheme;       // for example: (ENCR_BASE64 | ENCR_PASSWORD)
53     RawBuffer iv;               // encoded in base64
54     int dataSize;               // size of information without hash and padding
55     RawBuffer tag;              // tag for Aes Gcm algorithm
56 };
57
58 typedef std::vector<Row> RowVector;
59
60 } // namespace DB
61 } // namespace CKM
62