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-2021 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_CXX_SECURITY_SECURITY_COMMON_HPP
23
#define NDN_CXX_SECURITY_SECURITY_COMMON_HPP
24
25
#include "
ndn-cxx/detail/common.hpp
"
26
#include "
ndn-cxx/util/span.hpp
"
27
28
#include <vector>
29
30
namespace
ndn
{
31
32
namespace
signed_interest {
33
34
const
ssize_t
POS_SIG_VALUE
= -1;
35
const
ssize_t
POS_SIG_INFO
= -2;
36
40
const
size_t
MIN_SIZE
= 2;
41
42
}
// namespace signed_interest
43
44
namespace
command_interest {
45
46
using
signed_interest::POS_SIG_VALUE
;
47
using
signed_interest::POS_SIG_INFO
;
48
const
ssize_t
POS_RANDOM_VAL
= -3;
49
const
ssize_t
POS_TIMESTAMP
= -4;
50
54
const
size_t
MIN_SIZE
= 4;
55
56
}
// namespace command_interest
57
58
#ifndef DOXYGEN
59
using
InputBuffers = std::vector<span<const uint8_t>>;
60
#else
61
class
InputBuffers;
63
#endif
64
68
enum class
KeyIdType
{
74
USER_SPECIFIED
= 0,
80
SHA256
= 1,
86
RANDOM
= 2,
87
};
88
89
std::ostream&
90
operator<<
(std::ostream& os,
KeyIdType
keyIdType);
91
95
enum class
KeyType
{
96
NONE = 0,
97
RSA
,
98
EC
,
99
AES
,
100
HMAC
,
101
};
102
103
std::ostream&
104
operator<<
(std::ostream& os,
KeyType
keyType);
105
106
enum class
DigestAlgorithm
{
107
NONE = 0,
108
SHA224
,
109
SHA256
,
110
SHA384
,
111
SHA512
,
112
BLAKE2B_512
,
113
BLAKE2S_256
,
114
SHA3_224
,
115
SHA3_256
,
116
SHA3_384
,
117
SHA3_512
,
118
};
119
120
std::ostream&
121
operator<<
(std::ostream& os,
DigestAlgorithm
algorithm);
122
123
enum class
BlockCipherAlgorithm
{
124
NONE,
125
AES_CBC
,
126
};
127
128
std::ostream&
129
operator<<
(std::ostream& os,
BlockCipherAlgorithm
algorithm);
130
131
enum class
CipherOperator
{
132
DECRYPT
,
133
ENCRYPT
,
134
};
135
136
std::ostream&
137
operator<<
(std::ostream& os,
CipherOperator
op);
138
139
}
// namespace ndn
140
141
#endif // NDN_CXX_SECURITY_SECURITY_COMMON_HPP
ndn::command_interest::POS_RANDOM_VAL
const ssize_t POS_RANDOM_VAL
Definition:
security-common.hpp:48
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::DigestAlgorithm::SHA224
ndn::DigestAlgorithm::SHA3_384
ndn::KeyIdType
KeyIdType
The type of KeyId component in a key name.
Definition:
security-common.hpp:68
ndn::BlockCipherAlgorithm
BlockCipherAlgorithm
Definition:
security-common.hpp:123
ndn::operator<<
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition:
data.cpp:376
ndn::CipherOperator
CipherOperator
Definition:
security-common.hpp:131
ndn::KeyType::RSA
RSA key, supports sign/verify and encrypt/decrypt operations.
ndn::signed_interest::MIN_SIZE
const size_t MIN_SIZE
minimal number of components for Signed Interest
Definition:
security-common.hpp:40
ndn::KeyType::HMAC
HMAC key, supports sign/verify operations.
ndn::KeyType
KeyType
The type of a cryptographic key.
Definition:
security-common.hpp:95
common.hpp
Common includes and macros used throughout the library.
span.hpp
ndn::CipherOperator::DECRYPT
ndn::KeyType::EC
Elliptic Curve key (e.g. for ECDSA), supports sign/verify operations.
ndn::DigestAlgorithm::SHA3_512
ndn::KeyIdType::SHA256
Use the SHA-256 hash of the public key as key id.
ndn::DigestAlgorithm::SHA512
ndn::signed_interest::POS_SIG_VALUE
const ssize_t POS_SIG_VALUE
Definition:
security-common.hpp:34
ndn::DigestAlgorithm::SHA384
ndn::BlockCipherAlgorithm::AES_CBC
ndn::command_interest::POS_TIMESTAMP
const ssize_t POS_TIMESTAMP
Definition:
security-common.hpp:49
ndn::DigestAlgorithm::SHA3_224
ndn::signed_interest::POS_SIG_INFO
const ssize_t POS_SIG_INFO
Definition:
security-common.hpp:35
ndn::DigestAlgorithm::BLAKE2S_256
ndn::KeyIdType::RANDOM
Use a 64-bit random number as key id.
ndn::CipherOperator::ENCRYPT
ndn::KeyIdType::USER_SPECIFIED
User-specified key id.
ndn::DigestAlgorithm::SHA3_256
ndn::KeyType::AES
AES key, supports encrypt/decrypt operations.
ndn::DigestAlgorithm
DigestAlgorithm
Definition:
security-common.hpp:106
ndn::DigestAlgorithm::BLAKE2B_512
ndnSIM
ndn-cxx
ndn-cxx
security
security-common.hpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13