Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 2 | /** |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 6 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 7 | * 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 Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #ifndef NDN_SECURITY_COMMON_HPP |
Jeff Thompson | e589c3f | 2013-10-12 17:30:50 -0700 | [diff] [blame] | 23 | #define NDN_SECURITY_COMMON_HPP |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 24 | |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 25 | #include "../common.hpp" |
| 26 | |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 27 | namespace ndn { |
| 28 | |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 29 | namespace signed_interest { |
Yingdi Yu | 0f5fb69 | 2014-06-10 12:07:28 -0700 | [diff] [blame] | 30 | |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 31 | const ssize_t POS_SIG_VALUE = -1; |
| 32 | const ssize_t POS_SIG_INFO = -2; |
| 33 | const ssize_t POS_RANDOM_VAL = -3; |
| 34 | const ssize_t POS_TIMESTAMP = -4; |
Yingdi Yu | 0f5fb69 | 2014-06-10 12:07:28 -0700 | [diff] [blame] | 35 | |
Junxiao Shi | 198c381 | 2016-08-12 19:24:18 +0000 | [diff] [blame^] | 36 | /** \brief minimal number of components for Command Interest |
| 37 | * \sa https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest |
| 38 | */ |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 39 | const size_t MIN_LENGTH = 4; |
Yingdi Yu | 0f5fb69 | 2014-06-10 12:07:28 -0700 | [diff] [blame] | 40 | |
Junxiao Shi | 198c381 | 2016-08-12 19:24:18 +0000 | [diff] [blame^] | 41 | /** \brief minimal number of components for Signed Interest |
| 42 | * \sa https://redmine.named-data.net/projects/ndn-cxx/wiki/SignedInterest |
| 43 | */ |
| 44 | const size_t MIN_LENGTH_SIG_ONLY = 2; |
| 45 | |
Yingdi Yu | 0f5fb69 | 2014-06-10 12:07:28 -0700 | [diff] [blame] | 46 | } // namespace signed_interest |
| 47 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 48 | enum class KeyType { |
| 49 | NONE = 0, |
| 50 | RSA = 1, |
| 51 | EC = 2, |
| 52 | AES = 128 |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 55 | std::ostream& |
| 56 | operator<<(std::ostream& os, KeyType keyType); |
| 57 | |
| 58 | enum class KeyClass { |
| 59 | NONE, |
| 60 | PUBLIC, |
| 61 | PRIVATE, |
| 62 | SYMMETRIC |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 63 | }; |
Alexander Afanasyev | b78bc4d | 2014-04-09 21:20:52 -0700 | [diff] [blame] | 64 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 65 | std::ostream& |
| 66 | operator<<(std::ostream& os, KeyClass keyClass); |
| 67 | |
| 68 | enum class DigestAlgorithm { |
| 69 | NONE = 0, |
| 70 | SHA256 = 1 |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 73 | std::ostream& |
| 74 | operator<<(std::ostream& os, DigestAlgorithm algorithm); |
| 75 | |
| 76 | enum class BlockCipherAlgorithm { |
| 77 | NONE, |
| 78 | AES_CBC |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 79 | }; |
| 80 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 81 | std::ostream& |
| 82 | operator<<(std::ostream& os, BlockCipherAlgorithm algorithm); |
| 83 | |
Yingdi Yu | 8751661 | 2015-07-10 18:03:52 -0700 | [diff] [blame] | 84 | enum class CipherOperator { |
| 85 | DECRYPT = 0, |
| 86 | ENCRYPT = 1 |
| 87 | }; |
| 88 | |
| 89 | std::ostream& |
| 90 | operator<<(std::ostream& os, CipherOperator op); |
| 91 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 92 | enum class AclType { |
| 93 | NONE, |
| 94 | PUBLIC, |
| 95 | PRIVATE |
Yingdi Yu | 2e57a58 | 2014-02-20 23:34:43 -0800 | [diff] [blame] | 96 | }; |
| 97 | |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 98 | std::ostream& |
| 99 | operator<<(std::ostream& os, AclType aclType); |
| 100 | |
Yingdi Yu | 0f5fb69 | 2014-06-10 12:07:28 -0700 | [diff] [blame] | 101 | } // namespace ndn |
Jeff Thompson | 7b79eb6 | 2013-09-12 18:48:29 -0700 | [diff] [blame] | 102 | |
Yingdi Yu | ae73427 | 2015-07-04 17:38:48 -0700 | [diff] [blame] | 103 | #endif // NDN_SECURITY_COMMON_HPP |