Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jikencrypt Class Reference

Public Member Functions

 jikencrypt (std::shared_ptr< InterfacePP::jlogger > &logger, std::shared_ptr< jrand > &rand)
 
 ~jikencrypt ()=default
 Standard deconstructor.
 
int get_random (uint8_t *buf, uint32_t len)
 
bool encrypt (direction_t dir, std::shared_ptr< jikev2sa > &sa, jarray< uint8_t > &input, std::shared_ptr< jarray< uint8_t >> &output, std::shared_ptr< jarray< uint8_t >> &iv)
 
bool integrity (direction_t dir, std::shared_ptr< jikev2sa > &sa, jarray< uint8_t > &input, std::shared_ptr< jarray< uint8_t >> &icv)
 
 jikencrypt (jikencrypt &jikencrypt)=delete
 
 jikencrypt (const jikencrypt &jikencrypt)=delete
 

Constructor & Destructor Documentation

◆ jikencrypt()

ProtocolPP::jikencrypt::jikencrypt ( std::shared_ptr< InterfacePP::jlogger > &  logger,
std::shared_ptr< jrand > &  rand 
)

Standard constructor

Parameters
logger- Logger object to write to
rand- randomizer

Member Function Documentation

◆ encrypt()

bool ProtocolPP::jikencrypt::encrypt ( direction_t  dir,
std::shared_ptr< jikev2sa > &  sa,
jarray< uint8_t > &  input,
std::shared_ptr< jarray< uint8_t >> &  output,
std::shared_ptr< jarray< uint8_t >> &  iv 
)

Encrypt the IKE transactions

Parameters
dir- Direction of processing
sa- IKE security association
input- packet to encrypt or decrypt
output- encrypted or decrypted packet
iv- IV generated for encryption/decryption

◆ get_random()

int ProtocolPP::jikencrypt::get_random ( uint8_t *  buf,
uint32_t  len 
)

Get random numbers from the kernel

Parameters
buf- buffer to hold random bytes
len- number of bytes to retrieve

◆ integrity()

bool ProtocolPP::jikencrypt::integrity ( direction_t  dir,
std::shared_ptr< jikev2sa > &  sa,
jarray< uint8_t > &  input,
std::shared_ptr< jarray< uint8_t >> &  icv 
)

Authenticate the IKE transactions

Parameters
dir- Direction of processing
sa- IKE security association
input- packet to authenticate
icv- Integrety check value (zero if direction is out)
Returns
Whether the ICV is correct or not

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