NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::transform Namespace Reference

Classes

class  Base64Decode
 The module to perform Base64 decoding transformation. More...
 
class  Base64Encode
 The module to perform Base64 encoding transformation. More...
 
class  BlockCipher
 The module to encrypt data using block cipher. More...
 
class  BoolSink
 A sink which outputs only one boolean value. More...
 
class  BufferSource
 A source taking a memory buffer as input. More...
 
class  DigestFilter
 The module to calculate digest. More...
 
class  Downstream
 The downstream interface of a transformation module. More...
 
class  Error
 Base class of transformation error. More...
 
class  HexDecode
 The module to perform hexadecimal decoding transformation. More...
 
class  HexEncode
 The module to perform hexadecimal encoding transformation. More...
 
class  HmacFilter
 The module to generate HMAC for input data. More...
 
class  PrivateKey
 Abstraction of private key in crypto transformation. More...
 
class  PublicKey
 Abstraction of public key in crypto transformation. More...
 
class  SignerFilter
 The module to sign data. More...
 
class  Sink
 Abstraction of the transformation sink module. More...
 
class  Source
 Abstraction of the transformation source module. More...
 
class  StepSource
 A source that can accept input step by step, and can close input explicitly. More...
 
class  StreamSink
 A sink which directs output to an std::ostream. More...
 
class  StreamSource
 A source taking an std::istream as input. More...
 
class  StripSpace
 strip whitespace characters from a stream More...
 
class  Transform
 Abstraction of an intermediate transformation module. More...
 
class  Upstream
 The upstream interface of a transformation module. More...
 
class  VerifierFilter
 The module to verify signatures. More...
 

Typedefs

typedef BufferSource bufferSource
 
typedef StepSource stepSource
 
typedef StreamSource streamSource
 

Functions

unique_ptr< Transformbase64Decode (bool expectNewlineEvery64Bytes)
 
unique_ptr< Transformbase64Encode (bool needBreak)
 
unique_ptr< TransformblockCipher (BlockCipherAlgorithm algo, CipherOperator op, const uint8_t *key, size_t keyLen, const uint8_t *iv, size_t ivLen)
 
unique_ptr< SinkboolSink (bool &value)
 
unique_ptr< TransformdigestFilter (DigestAlgorithm algo)
 
unique_ptr< TransformhexDecode ()
 
unique_ptr< TransformhexEncode (bool useUpperCase)
 
unique_ptr< TransformhmacFilter (DigestAlgorithm algo, const uint8_t *key, size_t keyLen)
 
static void opensslInitAlgorithms ()
 
static int passwordCallbackWrapper (char *buf, int size, int rwflag, void *u)
 
unique_ptr< PrivateKeygeneratePrivateKey (const KeyParams &keyParams)
 Generate a private key according to keyParams. More...
 
unique_ptr< TransformsignerFilter (DigestAlgorithm algo, const PrivateKey &key)
 
unique_ptr< SinkstreamSink (std::ostream &os)
 
unique_ptr< TransformstripSpace (const char *whitespaces=StripSpace::DEFAULT_WHITESPACES)
 constructs a StripSpace transform More...
 
unique_ptr< TransformverifierFilter (DigestAlgorithm algo, const PublicKey &key, const uint8_t *sig, size_t sigLen)
 

Variables

static const size_t BUFFER_LENGTH = 1024
 
static const int8_t C2H []
 
static const uint8_t H2CL []
 
static const uint8_t H2CU []
 

Typedef Documentation

◆ bufferSource

◆ stepSource

◆ streamSource

Function Documentation

◆ base64Decode()

unique_ptr< Transform > ndn::security::transform::base64Decode ( bool  expectNewlineEvery64Bytes)

◆ base64Encode()

◆ blockCipher()

unique_ptr< Transform > ndn::security::transform::blockCipher ( BlockCipherAlgorithm  algo,
CipherOperator  op,
const uint8_t *  key,
size_t  keyLen,
const uint8_t *  iv,
size_t  ivLen 
)

Definition at line 160 of file block-cipher.cpp.

◆ boolSink()

unique_ptr< Sink > ndn::security::transform::boolSink ( bool &  value)

◆ digestFilter()

◆ hexDecode()

unique_ptr< Transform > ndn::security::transform::hexDecode ( )

Definition at line 114 of file hex-decode.cpp.

Referenced by ndn::fromHex(), and ndn::io::loadBlock().

◆ hexEncode()

unique_ptr< Transform > ndn::security::transform::hexEncode ( bool  useUpperCase)

◆ hmacFilter()

unique_ptr< Transform > ndn::security::transform::hmacFilter ( DigestAlgorithm  algo,
const uint8_t *  key,
size_t  keyLen 
)

Definition at line 97 of file hmac-filter.cpp.

◆ opensslInitAlgorithms()

static void ndn::security::transform::opensslInitAlgorithms ( )
static

◆ passwordCallbackWrapper()

static int ndn::security::transform::passwordCallbackWrapper ( char *  buf,
int  size,
int  rwflag,
void *  u 
)
inlinestatic

Definition at line 153 of file private-key.cpp.

Referenced by ndn::security::transform::PrivateKey::loadPkcs8().

◆ generatePrivateKey()

unique_ptr< PrivateKey > ndn::security::transform::generatePrivateKey ( const KeyParams keyParams)

Generate a private key according to keyParams.

Note
The public key can be derived from the private key.
Exceptions
std::invalid_argumentthe specified key type is not supported
std::runtime_errorkey generation fails

Definition at line 432 of file private-key.cpp.

References ndn::EC, ndn::SimplePublicKeyParams< KeyParamsInfo >::getKeySize(), ndn::KeyParams::getKeyType(), and ndn::RSA.

◆ signerFilter()

unique_ptr< Transform > ndn::security::transform::signerFilter ( DigestAlgorithm  algo,
const PrivateKey key 
)

Definition at line 83 of file signer-filter.cpp.

◆ streamSink()

◆ stripSpace()

unique_ptr< Transform > ndn::security::transform::stripSpace ( const char *  whitespaces = StripSpace::DEFAULT_WHITESPACES)

constructs a StripSpace transform

Parameters
whitespacescharacters classified as whitespaces, terminated with null

Definition at line 55 of file strip-space.cpp.

Referenced by ndn::io::loadBlock().

◆ verifierFilter()

unique_ptr< Transform > ndn::security::transform::verifierFilter ( DigestAlgorithm  algo,
const PublicKey key,
const uint8_t *  sig,
size_t  sigLen 
)

Variable Documentation

◆ BUFFER_LENGTH

const size_t ndn::security::transform::BUFFER_LENGTH = 1024
static

Definition at line 58 of file base64-decode.cpp.

◆ C2H

const int8_t ndn::security::transform::C2H[]
static
Initial value:
= {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
}

Definition at line 29 of file hex-decode.cpp.

◆ H2CL

const uint8_t ndn::security::transform::H2CL[]
static
Initial value:
= {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
}

Definition at line 28 of file hex-encode.cpp.

◆ H2CU

const uint8_t ndn::security::transform::H2CU[]
static
Initial value:
= {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
}

Definition at line 34 of file hex-encode.cpp.