Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jconfidentsa Class Reference
Inheritance diagram for ProtocolPP::jconfidentsa:
Collaboration diagram for ProtocolPP::jconfidentsa:

Public Member Functions

 jconfidentsa ()
 
 jconfidentsa (cipher_t cipher, direction_t dir, std::shared_ptr< jarray< uint8_t >> &key, std::shared_ptr< jarray< uint8_t >> &iv, uint32_t icvlen=0, uint32_t aadlen=0, uint32_t count=0, uint8_t bearer=0)
 
 jconfidentsa (jconfidentsa &rhs)
 standard copy constructor
 
 jconfidentsa (std::shared_ptr< jconfidentsa > &rhs)
 standard copy constructor from shared pointer
 
 ~jconfidentsa ()
 Standard deconstructor.
 
template<typename T >
void set_field (field_t field, T fieldval)
 
template<typename T >
get_field (field_t field)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
 jconfidentsa (const jconfidentsa &rhs)=delete
 
- Public Member Functions inherited from ProtocolPP::jsecass
 jsecass ()
 
virtual ~jsecass ()=default
 Standard deconstructor.
 
 jsecass (jsecass &jsecass)=delete
 
 jsecass (const jsecass &jsecass)=delete
 

Constructor & Destructor Documentation

◆ jconfidentsa() [1/2]

ProtocolPP::jconfidentsa::jconfidentsa ( )

Constructor for default values as follows

Confidentiality Defaults
fieldDefault Value
ciphercipher_t::AES
modemode_t::CBC
dirdirection_t::ENC
keyjarray<uint8_t>(0)
ivjarray<uint8_t>(0)
icvlen0
aadlen0
count0
bearer0
conf.set_field<cipher_t>(field_t::CIPHER, cipher_t::SM4);
conf.set_field<uint32_t>(field_t::COUNT, 0xAA11BB22);
conf.set_field<mode_t>(field_t::MODE, mode_t::GCM);
cipher_t
Definition: jenum.h:1759

◆ jconfidentsa() [2/2]

ProtocolPP::jconfidentsa::jconfidentsa ( cipher_t  cipher,
direction_t  dir,
std::shared_ptr< jarray< uint8_t >> &  key,
std::shared_ptr< jarray< uint8_t >> &  iv,
uint32_t  icvlen = 0,
uint32_t  aadlen = 0,
uint32_t  count = 0,
uint8_t  bearer = 0 
)

Standard constructor (NOTE: SNOWE and ZUCE are the 3GPP implementations, not just the encryption algorithms)

Parameters
cipher- Cipher to use (AES, SERPENT, DES, CAMELLIA, SEED, ARIA, ZUCE, SM4, SNOWE, SNOWV, SNOWV_GCM, CHACHA20)
dir- Direction of processing (ENC, DEC, UPLINK, DOWNLINK)
key- Cipher key
iv- Initialization vector
icvlen- Length of the ICV tag (for AEAD modes)
aadlen- Length of the prepended AAD data
count- Count for ZUCE and SNOWE (not for SNOW-V)
bearer- Bearer for ZUCE and SNOWE (not for SNOW-V)

Member Function Documentation

◆ get_field()

template<typename T >
T ProtocolPP::jconfidentsa::get_field ( field_t  field)

Get the specified field template value

Confidentsa Get Fields
field typefield nameExample
cipher_tCIPHERcipher_t tmp = get_field<cipher_t>(field_t::CIPHER)
direction_tDIRECTIONdirection_t tmp = get_field<direction_t>(field_t::DIRECTION)
uint32_tICVLENuint32_t tmp = get_field<uint32_t>(field_t::ICVLEN)
uint32_tAADLENuint32_t tmp = get_field<uint32_t>(field_t::AADLEN)
uint32_tCOUNTuint32_t tmp = get_field<uint32_t>(field_t::COUNT)
uint32_tBLOCKSIZEuint32_t tmp = get_field<uint32_t>(field_t::BLOCKSIZE)
uint8_tBEARERuint8_t tmp = get_field<uint8_t>(field_t::BEARER)
jarray<uint8_t>CIPHERKEYjarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::CIPHERKEY)
jarray<uint8_t>IVjarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::IV)
std::shared_ptr<jarray<uint8_t>>CIPHERKEYstd::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY)
std::shared_ptr<jarray<uint8_t>>IVstd::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::IV)
Parameters
field- field to retrieve
Returns
Value of the field requested

◆ set_field()

template<typename T >
void ProtocolPP::jconfidentsa::set_field ( field_t  field,
fieldval 
)

Set the specified field with a new template value

Confidentsa Set Fields
field typefield nameExample
cipher_tCIPHERset_field<cipher_t>(field_t::CIPHER, cipher_t::SERPENT)
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::ENC)
uint32_tICVLENset_field<uint32_t>(field_t::ICVLEN, 16)
uint32_tAADLENset_field<uint32_t>(field_t::AADLEN, 16)
uint32_tCOUNTset_field<uint32_t>(field_t::COUNT, 16)
uint32_tBLOCKSIZEset_field<uint32_t>(field_t::BLOCKSIZE, 8)
uint8_tBEARERset_field<uint8_t>(field_t::BEARER, 5)
jarray<uint8_t>CIPHERKEYset_field<jarray<uint8_t>>(field_t::CIPHERKEY, mykey)
jarray<uint8_t>IVset_field<jarray<uint8_t>>(field_t::IV, myiv)
std::shared_ptr<jarray<uint8_t>>CIPHERKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, mykeyptr)
std::shared_ptr<jarray<uint8_t>>IVset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::IV, myivptr)
Parameters
field- field to set
fieldval- New value to set in field

◆ to_json()

void ProtocolPP::jconfidentsa::to_json ( std::ofstream &  myjson,
direction_t  direction,
std::string &  indent 
)
virtual

to_json Convert the security association to JSON for printing

Parameters
myjson- JSON printing object
direction- direction of processing
indent- indentation for JSON output

Implements ProtocolPP::jsecass.

◆ to_xml()

void ProtocolPP::jconfidentsa::to_xml ( tinyxml2::XMLPrinter myxml,
direction_t  direction 
)
virtual

to_xml Convert the security association to XML for printing

Parameters
myxml- XML printing object
direction- direction of processing

Implements ProtocolPP::jsecass.


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