blob: 542e169d68bd484e1798e83b492d6a88e52709d3 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Jeff Thompson7b79eb62013-09-12 18:48:29 -07002/**
Yingdi Yuae734272015-07-04 17:38:48 -07003 * Copyright (c) 2013-2016 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.
Jeff Thompson7b79eb62013-09-12 18:48:29 -070020 */
21
22#ifndef NDN_SECURITY_COMMON_HPP
Jeff Thompsone589c3f2013-10-12 17:30:50 -070023#define NDN_SECURITY_COMMON_HPP
Jeff Thompson7b79eb62013-09-12 18:48:29 -070024
Yingdi Yuae734272015-07-04 17:38:48 -070025#include "../common.hpp"
26
Jeff Thompson7b79eb62013-09-12 18:48:29 -070027namespace ndn {
28
Yingdi Yuae734272015-07-04 17:38:48 -070029namespace signed_interest {
Yingdi Yu0f5fb692014-06-10 12:07:28 -070030
Yingdi Yuae734272015-07-04 17:38:48 -070031const ssize_t POS_SIG_VALUE = -1;
32const ssize_t POS_SIG_INFO = -2;
33const ssize_t POS_RANDOM_VAL = -3;
34const ssize_t POS_TIMESTAMP = -4;
Yingdi Yu0f5fb692014-06-10 12:07:28 -070035
Junxiao Shi198c3812016-08-12 19:24:18 +000036/** \brief minimal number of components for Command Interest
37 * \sa https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest
38 */
Yingdi Yuae734272015-07-04 17:38:48 -070039const size_t MIN_LENGTH = 4;
Yingdi Yu0f5fb692014-06-10 12:07:28 -070040
Junxiao Shi198c3812016-08-12 19:24:18 +000041/** \brief minimal number of components for Signed Interest
42 * \sa https://redmine.named-data.net/projects/ndn-cxx/wiki/SignedInterest
43 */
44const size_t MIN_LENGTH_SIG_ONLY = 2;
45
Yingdi Yu0f5fb692014-06-10 12:07:28 -070046} // namespace signed_interest
47
Yingdi Yu99b2a002015-08-12 12:47:44 -070048enum class KeyType {
49 NONE = 0,
50 RSA = 1,
51 EC = 2,
52 AES = 128
Jeff Thompson7b79eb62013-09-12 18:48:29 -070053};
54
Yingdi Yu99b2a002015-08-12 12:47:44 -070055std::ostream&
56operator<<(std::ostream& os, KeyType keyType);
57
58enum class KeyClass {
59 NONE,
60 PUBLIC,
61 PRIVATE,
62 SYMMETRIC
Jeff Thompson7b79eb62013-09-12 18:48:29 -070063};
Alexander Afanasyevb78bc4d2014-04-09 21:20:52 -070064
Yingdi Yu99b2a002015-08-12 12:47:44 -070065std::ostream&
66operator<<(std::ostream& os, KeyClass keyClass);
67
68enum class DigestAlgorithm {
69 NONE = 0,
70 SHA256 = 1
Jeff Thompson7b79eb62013-09-12 18:48:29 -070071};
72
Yingdi Yu99b2a002015-08-12 12:47:44 -070073std::ostream&
74operator<<(std::ostream& os, DigestAlgorithm algorithm);
75
76enum class BlockCipherAlgorithm {
77 NONE,
78 AES_CBC
Jeff Thompson7b79eb62013-09-12 18:48:29 -070079};
80
Yingdi Yu99b2a002015-08-12 12:47:44 -070081std::ostream&
82operator<<(std::ostream& os, BlockCipherAlgorithm algorithm);
83
Yingdi Yu87516612015-07-10 18:03:52 -070084enum class CipherOperator {
85 DECRYPT = 0,
86 ENCRYPT = 1
87};
88
89std::ostream&
90operator<<(std::ostream& os, CipherOperator op);
91
Yingdi Yu99b2a002015-08-12 12:47:44 -070092enum class AclType {
93 NONE,
94 PUBLIC,
95 PRIVATE
Yingdi Yu2e57a582014-02-20 23:34:43 -080096};
97
Yingdi Yu99b2a002015-08-12 12:47:44 -070098std::ostream&
99operator<<(std::ostream& os, AclType aclType);
100
Yingdi Yu0f5fb692014-06-10 12:07:28 -0700101} // namespace ndn
Jeff Thompson7b79eb62013-09-12 18:48:29 -0700102
Yingdi Yuae734272015-07-04 17:38:48 -0700103#endif // NDN_SECURITY_COMMON_HPP