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;
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) {
78  os << "NONE";
79  break;
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) {
95  os << "NONE";
96  break;
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) {
112  os << "DECRYPT";
113  break;
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
Copyright (c) 2011-2015 Regents of the University of California.
BlockCipherAlgorithm
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition: data.cpp:320