/* * Copyright (c) 2015 - 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License * * * @file InitialValueHandler.h * @author Maciej Karpiuk (m.karpiuk2@samsung.com) * @version 1.0 * @brief InitialValueHandler class. */ #ifndef INITIALVALUEHANDLER_H_ #define INITIALVALUEHANDLER_H_ #include #include #include #include #include #include #include #include namespace CKM { namespace InitialValues { class InitialValueHandler : public NoCharactersHandler { public: typedef std::shared_ptr InitialValueHandlerPtr; explicit InitialValueHandler(CKMLogic &db_logic, const CKM::RawBuffer &encryptedKey) : m_exportable(false), m_backend(PolicyBackend::DEFAULT), m_db_logic(db_logic), m_encryptedKey(encryptedKey) {} virtual ~InitialValueHandler() {} BufferHandler::BufferHandlerPtr CreateBufferHandler(EncodingType type); PermissionHandler::PermissionHandlerPtr CreatePermissionHandler(); virtual void Start(const XML::Parser::Attributes &); virtual void End(); protected: virtual DataType getDataType() const = 0; Alias m_name; Password m_password; bool m_exportable; PolicyBackend m_backend; CKMLogic &m_db_logic; const CKM::RawBuffer &m_encryptedKey; BufferHandler::BufferHandlerPtr m_bufferHandler; std::vector m_permissions; }; } } #endif /* INITIALVALUEHANDLER_H_ */