blob: af5c12d8eaa8a414cb1ac4813628336a0b2234ea [file] [log] [blame]
Jeff Thompson79a2d5d2013-09-27 14:32:23 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07003 * Copyright (c) 2013-2014, Regents of the University of California.
4 * All rights reserved.
5 *
6 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
7 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
8 *
9 * This file licensed under New BSD License. See COPYING for detailed information about
10 * ndn-cxx library copyright, permissions, and redistribution restrictions.
11 *
12 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070013 */
14
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070015#ifndef NDN_SECURITY_ENCRYPTION_MANAGER_HPP
16#define NDN_SECURITY_ENCRYPTION_MANAGER_HPP
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070017
18#include "../../name.hpp"
19#include "../security-common.hpp"
20
21namespace ndn {
22
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070023class EncryptionManager
24{
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070025public:
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070026 virtual ~EncryptionManager()
27 {
28 }
29
30 virtual void
31 createSymmetricKey(const Name& keyName, KeyType keyType,
32 const Name& signkeyName = Name(), bool isSymmetric = true) = 0;
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070033
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080034 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070035 encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070036 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
37
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080038 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070039 decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070040 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
41};
42
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070043} // namespace ndn
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070044
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070045#endif // NDN_SECURITY_ENCRYPTION_MANAGER_HPP