security-common.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_SECURITY_COMMON_HPP
23 #define NDN_SECURITY_SECURITY_COMMON_HPP
24 
25 #include "../common.hpp"
26 
27 #define NDN_CXX_KEEP_SECURITY_V1_ALIASES
28 
29 namespace ndn {
30 
31 namespace signed_interest {
32 
33 const ssize_t POS_SIG_VALUE = -1;
34 const ssize_t POS_SIG_INFO = -2;
35 
39 const size_t MIN_SIZE = 2;
40 
44 const size_t MIN_LENGTH = 4;
45 
48 const size_t MIN_LENGTH_SIG_ONLY = 2;
49 
50 } // namespace signed_interest
51 
52 namespace command_interest {
53 
56 const ssize_t POS_RANDOM_VAL = -3;
57 const ssize_t POS_TIMESTAMP = -4;
58 
62 const size_t MIN_SIZE = 4;
63 
64 } // namespace command_interest
65 
66 namespace signed_interest {
67 
72 
77 
78 } // namespace signed_interest
79 
83 enum class KeyIdType {
89  USER_SPECIFIED = 0,
95  SHA256 = 1,
101  RANDOM = 2
102 };
103 
104 std::ostream&
105 operator<<(std::ostream& os, KeyIdType keyIdType);
106 
107 enum class KeyType {
108  NONE = 0,
109  RSA = 1,
110  EC = 2,
111  AES = 128
112 };
113 
114 std::ostream&
115 operator<<(std::ostream& os, KeyType keyType);
116 
117 enum class KeyClass {
118  NONE,
119  PUBLIC,
120  PRIVATE,
121  SYMMETRIC
122 };
123 
124 std::ostream&
125 operator<<(std::ostream& os, KeyClass keyClass);
126 
127 enum class DigestAlgorithm {
128  NONE = 0,
129  SHA256 = 1
130 };
131 
132 std::ostream&
133 operator<<(std::ostream& os, DigestAlgorithm algorithm);
134 
136  NONE,
137  AES_CBC
138 };
139 
140 std::ostream&
141 operator<<(std::ostream& os, BlockCipherAlgorithm algorithm);
142 
143 enum class CipherOperator {
144  DECRYPT = 0,
145  ENCRYPT = 1
146 };
147 
148 std::ostream&
149 operator<<(std::ostream& os, CipherOperator op);
150 
151 enum class AclType {
152  NONE,
153  PUBLIC,
154  PRIVATE
155 };
156 
157 std::ostream&
158 operator<<(std::ostream& os, AclType aclType);
159 
160 namespace security {
161 namespace transform {
162 class PublicKey;
163 } // namespace transform
164 namespace v2 {
166 } // namespace v2
167 } // namespace security
168 
169 } // namespace ndn
170 
171 #endif // NDN_SECURITY_SECURITY_COMMON_HPP
const ssize_t POS_RANDOM_VAL
Copyright (c) 2013-2016 Regents of the University of California.
Definition: common.hpp:74
KeyIdType
The type of KeyId component in a key name.
BlockCipherAlgorithm
std::ostream & operator<<(std::ostream &os, const Data &data)
Definition: data.cpp:320
const size_t MIN_SIZE
minimal number of components for Signed Interest
Abstraction of public key in crypto transformation.
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.
const size_t MIN_LENGTH_SIG_ONLY
User-specified key ID.