blob: 8594581779b544f13a0cb8228978d0ee0b7b360b [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
Yingdi Yuae734272015-07-04 17:38:48 -070036const size_t MIN_LENGTH = 4;
Yingdi Yu0f5fb692014-06-10 12:07:28 -070037
38} // namespace signed_interest
39
Yingdi Yu99b2a002015-08-12 12:47:44 -070040enum class KeyType {
41 NONE = 0,
42 RSA = 1,
43 EC = 2,
44 AES = 128
Jeff Thompson7b79eb62013-09-12 18:48:29 -070045};
46
Yingdi Yu99b2a002015-08-12 12:47:44 -070047std::ostream&
48operator<<(std::ostream& os, KeyType keyType);
49
50enum class KeyClass {
51 NONE,
52 PUBLIC,
53 PRIVATE,
54 SYMMETRIC
Jeff Thompson7b79eb62013-09-12 18:48:29 -070055};
Alexander Afanasyevb78bc4d2014-04-09 21:20:52 -070056
Yingdi Yu99b2a002015-08-12 12:47:44 -070057std::ostream&
58operator<<(std::ostream& os, KeyClass keyClass);
59
60enum class DigestAlgorithm {
61 NONE = 0,
62 SHA256 = 1
Jeff Thompson7b79eb62013-09-12 18:48:29 -070063};
64
Yingdi Yu99b2a002015-08-12 12:47:44 -070065std::ostream&
66operator<<(std::ostream& os, DigestAlgorithm algorithm);
67
68enum class BlockCipherAlgorithm {
69 NONE,
70 AES_CBC
Jeff Thompson7b79eb62013-09-12 18:48:29 -070071};
72
Yingdi Yu99b2a002015-08-12 12:47:44 -070073std::ostream&
74operator<<(std::ostream& os, BlockCipherAlgorithm algorithm);
75
Yingdi Yu87516612015-07-10 18:03:52 -070076enum class CipherOperator {
77 DECRYPT = 0,
78 ENCRYPT = 1
79};
80
81std::ostream&
82operator<<(std::ostream& os, CipherOperator op);
83
Yingdi Yu99b2a002015-08-12 12:47:44 -070084enum class AclType {
85 NONE,
86 PUBLIC,
87 PRIVATE
Yingdi Yu2e57a582014-02-20 23:34:43 -080088};
89
Yingdi Yu99b2a002015-08-12 12:47:44 -070090std::ostream&
91operator<<(std::ostream& os, AclType aclType);
92
Yingdi Yu0f5fb692014-06-10 12:07:28 -070093} // namespace ndn
Jeff Thompson7b79eb62013-09-12 18:48:29 -070094
Yingdi Yuae734272015-07-04 17:38:48 -070095#endif // NDN_SECURITY_COMMON_HPP