|
| 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 > |
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 |
|
| jsecass () |
|
virtual | ~jsecass ()=default |
| Standard deconstructor.
|
|
| jsecass (jsecass &jsecass)=delete |
|
| jsecass (const jsecass &jsecass)=delete |
|
◆ jconfidentsa() [1/2]
ProtocolPP::jconfidentsa::jconfidentsa |
( |
| ) |
|
Constructor for default values as follows
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) |
◆ get_field()
template<typename T >
T ProtocolPP::jconfidentsa::get_field |
( |
field_t |
field | ) |
|
Get the specified field template value
Confidentsa Get Fields
field type | field name | Example |
cipher_t | CIPHER | cipher_t tmp = get_field<cipher_t>(field_t::CIPHER) |
direction_t | DIRECTION | direction_t tmp = get_field<direction_t>(field_t::DIRECTION) |
uint32_t | ICVLEN | uint32_t tmp = get_field<uint32_t>(field_t::ICVLEN) |
uint32_t | AADLEN | uint32_t tmp = get_field<uint32_t>(field_t::AADLEN) |
uint32_t | COUNT | uint32_t tmp = get_field<uint32_t>(field_t::COUNT) |
uint32_t | BLOCKSIZE | uint32_t tmp = get_field<uint32_t>(field_t::BLOCKSIZE) |
uint8_t | BEARER | uint8_t tmp = get_field<uint8_t>(field_t::BEARER) |
jarray<uint8_t> | CIPHERKEY | jarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::CIPHERKEY) |
jarray<uint8_t> | IV | jarray<uint8_t> tmp = get_field<jarray<uint8_t>>(field_t::IV) |
std::shared_ptr<jarray<uint8_t>> | CIPHERKEY | std::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY) |
std::shared_ptr<jarray<uint8_t>> | IV | std::shared_ptr<jarray<uint8_t>> tmp = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::IV) |
- Parameters
-
- Returns
- Value of the field requested
◆ set_field()
template<typename T >
void ProtocolPP::jconfidentsa::set_field |
( |
field_t |
field, |
|
|
T |
fieldval |
|
) |
| |
Set the specified field with a new template value
Confidentsa Set Fields
field type | field name | Example |
cipher_t | CIPHER | set_field<cipher_t>(field_t::CIPHER, cipher_t::SERPENT) |
direction_t | DIRECTION | set_field<direction_t>(field_t::DIRECTION, direction_t::ENC) |
uint32_t | ICVLEN | set_field<uint32_t>(field_t::ICVLEN, 16) |
uint32_t | AADLEN | set_field<uint32_t>(field_t::AADLEN, 16) |
uint32_t | COUNT | set_field<uint32_t>(field_t::COUNT, 16) |
uint32_t | BLOCKSIZE | set_field<uint32_t>(field_t::BLOCKSIZE, 8) |
uint8_t | BEARER | set_field<uint8_t>(field_t::BEARER, 5) |
jarray<uint8_t> | CIPHERKEY | set_field<jarray<uint8_t>>(field_t::CIPHERKEY, mykey) |
jarray<uint8_t> | IV | set_field<jarray<uint8_t>>(field_t::IV, myiv) |
std::shared_ptr<jarray<uint8_t>> | CIPHERKEY | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, mykeyptr) |
std::shared_ptr<jarray<uint8_t>> | IV | set_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()
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: