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

The module to encrypt data using block cipher. More...

#include <block-cipher.hpp>

Inheritance diagram for ndn::security::transform::BlockCipher:
Collaboration diagram for ndn::security::transform::BlockCipher:

Classes

class  Impl
 

Public Member Functions

 BlockCipher (BlockCipherAlgorithm algo, CipherOperator op, span< const uint8_t > key, span< const uint8_t > iv)
 Create a block cipher. More...
 
 ~BlockCipher () final
 
- Public Member Functions inherited from ndn::security::transform::Upstream
virtual ~Upstream ()=default
 
- Public Member Functions inherited from ndn::security::transform::Downstream
virtual ~Downstream ()=default
 
size_t write (span< const uint8_t > buf)
 Accept input data and perform transformation. More...
 
void end ()
 Close the input interface of a module. More...
 
bool isEnd () const
 Check if the input interface of a module is closed. More...
 
void setIndex (size_t index)
 Set the module index. More...
 
size_t getIndex () const
 Get the module index. More...
 

Additional Inherited Members

- Protected Types inherited from ndn::security::transform::Transform
using OBuffer = std::vector< uint8_t >
 
- Protected Member Functions inherited from ndn::security::transform::Transform
 Transform ()=default
 
void flushOutputBuffer ()
 Read the content from output buffer and write it into next module. More...
 
void flushAllOutput ()
 Read the all the content from output buffer and write it into next module. More...
 
void setOutputBuffer (unique_ptr< OBuffer > buffer)
 Set output buffer to buffer. More...
 
bool isOutputBufferEmpty () const
 Check if output buffer is empty. More...
 
- Protected Member Functions inherited from ndn::security::transform::Upstream
 Upstream ()=default
 
void appendChain (unique_ptr< Downstream > tail)
 Connect to the next transformation module. More...
 
DownstreamgetNext ()
 
- Protected Member Functions inherited from ndn::security::transform::Downstream
 Downstream ()=default
 
- Protected Attributes inherited from ndn::security::transform::Upstream
unique_ptr< Downstreamm_next
 

Detailed Description

The module to encrypt data using block cipher.

The padding scheme of the block cipher is set to the OpenSSL default, which is PKCS padding.

Definition at line 38 of file block-cipher.hpp.

Constructor & Destructor Documentation

◆ BlockCipher()

ndn::security::transform::BlockCipher::BlockCipher ( BlockCipherAlgorithm  algo,
CipherOperator  op,
span< const uint8_t >  key,
span< const uint8_t >  iv 
)

Create a block cipher.

Parameters
algoThe block cipher algorithm to use.
opThe operation to perform (encrypt or decrypt).
keyThe symmetric key.
ivThe initialization vector.

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

References ndn::AES_CBC, ndn::ENCRYPT, ndn::security::transform::Transform::flushOutputBuffer(), ndn::security::transform::Downstream::getIndex(), ndn::security::transform::Transform::isOutputBufferEmpty(), nonstd::optional_lite::std11::move(), NDN_THROW, ndn::security::transform::Transform::setOutputBuffer(), ndn::to_string(), and ~BlockCipher().

◆ ~BlockCipher()

ndn::security::transform::BlockCipher::~BlockCipher ( )
finaldefault

Referenced by BlockCipher().


The documentation for this class was generated from the following files: