blob: 030f44343ef8c843140d77736b1b1a751a4371c4 [file] [log] [blame]
Zhiyi Zhang19a11d22018-04-12 22:58:20 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014-2018, Regents of the University of California
4 *
5 * This file is part of gep (Group-based Encryption Protocol for NDN).
6 * See AUTHORS.md for complete list of gep authors and contributors.
7 *
8 * gep is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * gep is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * gep, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070020#ifndef NDN_GEP_ENCRYPT_PARAMS_HPP
21#define NDN_GEP_ENCRYPT_PARAMS_HPP
22
Yingdi Yub3c47762016-03-20 19:37:27 -070023#include "../tlv.hpp"
Zhiyi Zhang19a11d22018-04-12 22:58:20 -070024#include <ndn-cxx/encoding/buffer-stream.hpp>
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070025
26namespace ndn {
27namespace gep {
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070028namespace algo {
29
30class EncryptParams
31{
32public:
Prashanth Swaminathand5b3eae2015-07-09 15:37:05 -070033 EncryptParams(tlv::AlgorithmTypeValue algorithm, uint8_t ivLength = 0);
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070034
35 void
Prashanth Swaminathand5b3eae2015-07-09 15:37:05 -070036 setIV(const uint8_t* iv, size_t ivLen);
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070037
38 void
Prashanth Swaminathand5b3eae2015-07-09 15:37:05 -070039 setAlgorithmType(tlv::AlgorithmTypeValue algorithm);
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070040
41 Buffer
42 getIV() const;
43
Prashanth Swaminathand5b3eae2015-07-09 15:37:05 -070044 tlv::AlgorithmTypeValue
45 getAlgorithmType() const;
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070046
47private:
Prashanth Swaminathand5b3eae2015-07-09 15:37:05 -070048 tlv::AlgorithmTypeValue m_algo;
Prashanth Swaminathanc61cf192015-06-30 21:21:33 -070049 Buffer m_iv;
50};
51
52} // namespace algo
53} // namespace gep
54} // namespace ndn
55
56#endif // NDN_GEP_ENCRYPT_PARAMS_HPP