Replace RawData with RawBuffer.
[platform/core/security/key-manager.git] / src / manager / client / client-key-impl.h
1 /* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
2  *
3  *  Licensed under the Apache License, Version 2.0 (the "License");
4  *  you may not use this file except in compliance with the License.
5  *  You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  *  Unless required by applicable law or agreed to in writing, software
10  *  distributed under the License is distributed on an "AS IS" BASIS,
11  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  *  See the License for the specific language governing permissions and
13  *  limitations under the License
14  *
15  *
16  * @file        client-key-impl.h
17  * @author      Zofia Abramowska (z.abramowska@samsung.com)
18  * @version     1.0
19  * @brief       Key implementation.
20  */
21 #pragma once
22
23 //#include <dpl/serialization.h>
24
25 #include <ckm/ckm-type.h>
26 #include <ckm/key-manager.h>
27
28 namespace CKM {
29
30 class KeyImpl
31 //  : public ISerializable
32 {
33 public:
34     KeyImpl();
35 //  KeyImpl(IStream &stream);
36     KeyImpl(const RawBuffer &data, KeyType type, const RawBuffer &password);
37     KeyImpl(const KeyImpl &);
38     KeyImpl(KeyImpl &&);
39     KeyImpl& operator=(const KeyImpl &);
40     KeyImpl& operator=(KeyImpl &&);
41
42     KeyType getType() const {
43         return m_type;
44     }
45
46     RawBuffer getKey() const {
47         return m_key;
48     }
49
50     bool empty() const {
51         return (m_type == KeyType::KEY_NONE) || m_key.empty();
52     }
53
54 //    void Serialize(IStream &stream) const;
55
56     virtual ~KeyImpl();
57 private:
58     KeyType m_type;
59     RawBuffer m_key;
60 };
61
62 } // namespace CKM
63