blob: f4f43b51fad6158c87e82b3c70ad66a8656daa0d [file] [log] [blame]
Jeff Thompson79a2d5d2013-09-27 14:32:23 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * See COPYING for copyright and distribution information.
6 */
7
Yingdi Yu4b8c6a22014-04-15 23:00:54 -07008#ifndef NDN_SECURITY_ENCRYPTION_MANAGER_HPP
9#define NDN_SECURITY_ENCRYPTION_MANAGER_HPP
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070010
11#include "../../name.hpp"
12#include "../security-common.hpp"
13
14namespace ndn {
15
Alexander Afanasyev2a7f7202014-04-23 14:25:29 -070016class EncryptionManager
17{
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070018public:
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070019 virtual ~EncryptionManager()
20 {
21 }
22
23 virtual void
24 createSymmetricKey(const Name& keyName, KeyType keyType,
25 const Name& signkeyName = Name(), bool isSymmetric = true) = 0;
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070026
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080027 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070028 encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070029 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
30
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080031 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070032 decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070033 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
34};
35
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070036} // namespace ndn
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070037
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070038#endif // NDN_SECURITY_ENCRYPTION_MANAGER_HPP