1 /* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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
16 * @file client-key.cpp
17 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
19 * @brief Key - api implementation.
21 #include <ckm/ckm-type.h>
22 #include <ckm/ckm-manager.h>
24 #include <dpl/log/log.h>
26 #include <generic-key.h>
35 const RawBuffer &rawData,
36 const std::string &password,
40 m_impl.reset(new GenericKey(rawData, password));
43 Key::Key(const Key &second) {
44 m_impl = second.m_impl;
47 Key& Key::operator=(const Key &second) {
48 m_impl = second.m_impl;
54 bool Key::empty() const {
56 return m_impl->empty();
60 KeyType Key::getType() const {
62 return m_impl->getType();
63 return KeyType::KEY_NONE;
66 RawBuffer Key::getDER() const {
68 return m_impl->getDER();
72 GenericKey* Key::getImpl() const {