NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
security-common.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
security-common.hpp
"
23
#include <ostream>
24
25
namespace
ndn
{
26
27
std::ostream&
28
operator<<
(std::ostream& os,
KeyType
keyType)
29
{
30
switch
(keyType) {
31
case
KeyType::NONE
:
32
os <<
"NONE"
;
33
break
;
34
case
KeyType::RSA
:
35
os <<
"RSA"
;
36
break
;
37
case
KeyType::EC
:
38
os <<
"EC"
;
39
break
;
40
case
KeyType::AES
:
41
os <<
"AES"
;
42
break
;
43
default
:
44
os << static_cast<int>(keyType);
45
break
;
46
};
47
return
os;
48
}
49
50
std::ostream&
51
operator<<
(std::ostream& os,
KeyClass
keyClass)
52
{
53
switch
(keyClass) {
54
case
KeyClass::NONE
:
55
os <<
"NONE"
;
56
break
;
57
case
KeyClass::PUBLIC
:
58
os <<
"PUBLIC"
;
59
break
;
60
case
KeyClass::PRIVATE
:
61
os <<
"PRIVATE"
;
62
break
;
63
case
KeyClass::SYMMETRIC
:
64
os <<
"SYMMETRIC"
;
65
break
;
66
default
:
67
os << static_cast<int>(keyClass);
68
break
;
69
};
70
return
os;
71
}
72
73
std::ostream&
74
operator<<
(std::ostream& os,
DigestAlgorithm
algorithm)
75
{
76
switch
(algorithm) {
77
case
DigestAlgorithm::NONE
:
78
os <<
"NONE"
;
79
break
;
80
case
DigestAlgorithm::SHA256
:
81
os <<
"SHA256"
;
82
break
;
83
default
:
84
os << static_cast<int>(algorithm);
85
break
;
86
};
87
return
os;
88
}
89
90
std::ostream&
91
operator<<
(std::ostream& os,
BlockCipherAlgorithm
algorithm)
92
{
93
switch
(algorithm) {
94
case
BlockCipherAlgorithm::NONE
:
95
os <<
"NONE"
;
96
break
;
97
case
BlockCipherAlgorithm::AES_CBC
:
98
os <<
"AES_CBC"
;
99
break
;
100
default
:
101
os << static_cast<int>(algorithm);
102
break
;
103
};
104
return
os;
105
}
106
107
std::ostream&
108
operator<<
(std::ostream& os,
CipherOperator
op)
109
{
110
switch
(op) {
111
case
CipherOperator::DECRYPT
:
112
os <<
"DECRYPT"
;
113
break
;
114
case
CipherOperator::ENCRYPT
:
115
os <<
"ENCRYPT"
;
116
break
;
117
default
:
118
os << static_cast<int>(op);
119
break
;
120
};
121
return
os;
122
}
123
124
std::ostream&
125
operator<<
(std::ostream& os,
AclType
aclType)
126
{
127
switch
(aclType) {
128
case
AclType::NONE
:
129
os <<
"NONE"
;
130
break
;
131
case
AclType::PUBLIC
:
132
os <<
"PUBLIC"
;
133
break
;
134
case
AclType::PRIVATE
:
135
os <<
"PRIVATE"
;
136
break
;
137
default
:
138
os << static_cast<int>(aclType);
139
break
;
140
};
141
return
os;
142
}
143
144
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::KeyClass::SYMMETRIC
ndn::KeyType::NONE
ndn::BlockCipherAlgorithm
BlockCipherAlgorithm
Definition:
security-common.hpp:78
ndn::operator<<
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition:
data.cpp:320
ndn::CipherOperator
CipherOperator
Definition:
security-common.hpp:86
ndn::KeyType::RSA
ndn::KeyClass::NONE
ndn::KeyClass::PUBLIC
ndn::BlockCipherAlgorithm::NONE
ndn::KeyType
KeyType
Definition:
security-common.hpp:50
ndn::AclType::NONE
ndn::CipherOperator::DECRYPT
ndn::AclType
AclType
Definition:
security-common.hpp:94
ndn::KeyType::EC
ndn::BlockCipherAlgorithm::AES_CBC
ndn::KeyClass
KeyClass
Definition:
security-common.hpp:60
ndn::CipherOperator::ENCRYPT
ndn::DigestAlgorithm::SHA256
ndn::DigestAlgorithm::NONE
ndn::KeyType::AES
ndn::DigestAlgorithm
DigestAlgorithm
Definition:
security-common.hpp:70
ndn::KeyClass::PRIVATE
security-common.hpp
ndnSIM
ndn-cxx
src
security
security-common.cpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13