blob: a6f319b7892d75dcfd83ba0deda88768e05c00d2 [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
16class EncryptionManager {
17public:
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070018 virtual ~EncryptionManager()
19 {
20 }
21
22 virtual void
23 createSymmetricKey(const Name& keyName, KeyType keyType,
24 const Name& signkeyName = Name(), bool isSymmetric = true) = 0;
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070025
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080026 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070027 encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070028 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
29
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080030 virtual ConstBufferPtr
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070031 decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool useSymmetric = false,
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070032 EncryptMode encryptMode = ENCRYPT_MODE_DEFAULT) = 0;
33};
34
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070035} // namespace ndn
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070036
Yingdi Yu4b8c6a22014-04-15 23:00:54 -070037#endif // NDN_SECURITY_ENCRYPTION_MANAGER_HPP