blob: e1b0f0e9c398a522451f391738dc381828dcc2fd [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Jeff Thompson79a2d5d2013-09-27 14:32:23 -07002/**
Alexander Afanasyevc169a812014-05-20 20:37:29 -04003 * Copyright (c) 2013-2014 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -070020 *
21 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070022 */
23
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070024#ifndef NDN_SECURITY_ENCRYPTION_MANAGER_HPP
25#define NDN_SECURITY_ENCRYPTION_MANAGER_HPP
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070026
27#include "../../name.hpp"
28#include "../security-common.hpp"
29
30namespace ndn {
31
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070032class EncryptionManager
33{
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070034public:
Alexander Afanasyeva4297a62014-06-19 13:29:34 -070035 virtual
36 ~EncryptionManager()
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070037 {
38 }
39
40 virtual void
41 createSymmetricKey(const Name& keyName, KeyType keyType,
42 const Name& signkeyName = Name(), bool isSymmetric = true) = 0;
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070043
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080044 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070045 encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070046 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
47
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080048 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070049 decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070050 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
51};
52
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070053} // namespace ndn
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070054
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070055#endif // NDN_SECURITY_ENCRYPTION_MANAGER_HPP