NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
security-common.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2018 Regents of the University of California.
4  *
5  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6  *
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.
20  */
21 
22 #ifndef NDN_SECURITY_SECURITY_COMMON_HPP
23 #define NDN_SECURITY_SECURITY_COMMON_HPP
24 
26 
27 namespace ndn {
28 
29 namespace signed_interest {
30 
31 const ssize_t POS_SIG_VALUE = -1;
32 const ssize_t POS_SIG_INFO = -2;
33 
37 const size_t MIN_SIZE = 2;
38 
39 } // namespace signed_interest
40 
41 namespace command_interest {
42 
45 const ssize_t POS_RANDOM_VAL = -3;
46 const ssize_t POS_TIMESTAMP = -4;
47 
51 const size_t MIN_SIZE = 4;
52 
53 } // namespace command_interest
54 
58 enum class KeyIdType {
64  USER_SPECIFIED = 0,
70  SHA256 = 1,
76  RANDOM = 2,
77 };
78 
79 std::ostream&
80 operator<<(std::ostream& os, KeyIdType keyIdType);
81 
85 enum class KeyType {
86  NONE = 0,
87  RSA = 1,
88  EC = 2,
89  AES = 128,
90 };
91 
92 std::ostream&
93 operator<<(std::ostream& os, KeyType keyType);
94 
95 enum class KeyClass {
96  NONE,
97  PUBLIC,
98  PRIVATE,
99  SYMMETRIC,
100 };
101 
102 std::ostream&
103 operator<<(std::ostream& os, KeyClass keyClass);
104 
105 enum class DigestAlgorithm {
106  NONE = 0,
107  SHA224 = 2,
108  SHA256 = 1,
109  SHA384 = 3,
110  SHA512 = 4,
111  BLAKE2B_512 = 10,
112  BLAKE2S_256 = 11,
113  SHA3_224 = 20,
114  SHA3_256 = 21,
115  SHA3_384 = 22,
116  SHA3_512 = 23,
117 };
118 
119 std::ostream&
120 operator<<(std::ostream& os, DigestAlgorithm algorithm);
121 
123  NONE,
124  AES_CBC,
125 };
126 
127 std::ostream&
128 operator<<(std::ostream& os, BlockCipherAlgorithm algorithm);
129 
130 enum class CipherOperator {
131  DECRYPT = 0,
132  ENCRYPT = 1,
133 };
134 
135 std::ostream&
136 operator<<(std::ostream& os, CipherOperator op);
137 
138 enum class AclType {
139  NONE,
140  PUBLIC,
141  PRIVATE,
142 };
143 
144 std::ostream&
145 operator<<(std::ostream& os, AclType aclType);
146 
147 namespace security {
148 namespace transform {
149 class PublicKey;
150 } // namespace transform
151 namespace v2 {
153 } // namespace v2
154 } // namespace security
155 
156 } // namespace ndn
157 
158 #endif // NDN_SECURITY_SECURITY_COMMON_HPP
const ssize_t POS_RANDOM_VAL
Copyright (c) 2011-2015 Regents of the University of California.
Unknown key type.
KeyIdType
The type of KeyId component in a key name.
BlockCipherAlgorithm
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition: data.cpp:322
RSA key, supports sign/verify and encrypt/decrypt operations.
const size_t MIN_SIZE
minimal number of components for Signed Interest
Abstraction of public key in crypto transformation.
Definition: public-key.hpp:35
KeyType
The type of a cryptographic key.
import common constructs for ndn-cxx library internal use
Elliptic Curve key (e.g. for ECDSA), supports sign/verify operations.
const size_t MIN_SIZE
minimal number of components for Command Interest
Use the SHA256 hash of the public key as the key id.
const ssize_t POS_SIG_VALUE
const ssize_t POS_TIMESTAMP
const ssize_t POS_SIG_INFO
Use a 64-bit random number as the key id.
User-specified key ID.
AES key, supports encrypt/decrypt operations.