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

Public Member Functions

 jkybersa ()
 KYBER security association with default values.
 
 jkybersa (keymode_t mode, kyber_algorithm_t algorithm)
 
 jkybersa (keymode_t mode, kyber_algorithm_t algorithm, std::shared_ptr< jarray< uint8_t >> &prvkey, std::shared_ptr< jarray< uint8_t >> &pubkey)
 
 jkybersa (jkybersa &security)
 
 jkybersa (std::shared_ptr< jkybersa > &security)
 
 ~jkybersa ()
 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)
 
 jkybersa (const jkybersa &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

◆ jkybersa() [1/4]

ProtocolPP::jkybersa::jkybersa ( keymode_t  mode,
kyber_algorithm_t  algorithm 
)

KYBER security association with values chosen by algorithm

Parameters
mode- Mode of operation (GENKEYPAIR, KYBERENC, KYBERDEC)
algorithm- KYBER algorithm to use for keys and shared secret generation

◆ jkybersa() [2/4]

ProtocolPP::jkybersa::jkybersa ( keymode_t  mode,
kyber_algorithm_t  algorithm,
std::shared_ptr< jarray< uint8_t >> &  prvkey,
std::shared_ptr< jarray< uint8_t >> &  pubkey 
)

KYBER security association with values chosen by algorithm

Parameters
mode- Mode of operation (GENKEYPAIR, PKISIGN, PKIVERIFY)
algorithm- KYBER algorithm to use for keys and shared secret generation
prvkey- Previously generated private key
pubkey- Previously generated public key

◆ jkybersa() [3/4]

ProtocolPP::jkybersa::jkybersa ( jkybersa security)

KYBER security association copy constructor

Parameters
security- KYBER security association

◆ jkybersa() [4/4]

ProtocolPP::jkybersa::jkybersa ( std::shared_ptr< jkybersa > &  security)
explicit

KYBER security association copy constructor from shared descriptor

Parameters
security- KYBER security association

Member Function Documentation

◆ get_field()

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

Returns the field in KYBERSA

KYBER SA Get Fields
field typefield nameExample
direction_tDIRECTIONProtocolPP::direction_t mydir = get_field<ProtocolPP::direction_t>(ProtocolPP::field_t::DIRECTION)
kyber_algorithm_tAUTHProtocolPP::kyber_algorithm_t myalg = get_field<ProtocolPP::kyber_algorithm_t>(ProtocolPP::field_t::AUTH)
uint32_tPRVKEYLENuint32_t myprvlen = get_field<uint32_t>(ProtocolPP::field_t::PRVKEYLEN)
uint32_tPUBKEYLENuint32_t mypublen = get_field<uint32_t>(ProtocolPP::field_t::PUBKEYLEN)
uint32_tLENGTHuint32_t mylen = get_field<uint32_t>(ProtocolPP::field_t::LENGTH)
uint32_tSSLENuint32_t mysslen = get_field<uint32_t>(ProtocolPP::field_t::SSLEN)
jarray<uint8_t>PUBKEYjarray<uint8_t> mypubkey = get_field<jarray<uint8_t>>(ProtocolPP::field_t::PUBKEY)
uint8_t*PRVKEYuint8_t* myprvkey = get_field<uint8_t*>(ProtocolPP::field_t::PRVKEY)
uint8_t*PUBKEYuint8_t* mypubkey = get_field<uint8_t*>(ProtocolPP::field_t::PUBKEY)
std::shared_ptr<jarray<uint8_t>>PRVKEYstd::shared_ptr<jarray<uint8_t>> myprvkey = get_field<std::shared_ptr<jarray<uint8_t>>>(ProtocolPP::field_t::PRVKEY)
std::shared_ptr<jarray<uint8_t>>PUBKEYstd::shared_ptr<jarray<uint8_t>> mypubkey = get_field<std::shared_ptr<jarray<uint8_t>>>(ProtocolPP::field_t::PUBKEY)
Parameters
field- field to retrieve from the security association
Returns
value of the field in the security association

◆ set_field()

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

Allows the user to update the fields of KYBERSA security association

KYBER SA Set Fields
field typefield nameExample
kyber_algorithm_tAUTHset_field<kyber_algorithm_t>(ProtocolPP::field_t::AUTH, kyber_algorithm_t& fieldval)
jarray<uint8_t>PRVKEYset_field<jarray<uint8_t>>(ProtocolPP::field_t::PRVKEY, jarray<uint8_t>& fieldval)
jarray<uint8_t>PUBKEYset_field<jarray<uint8_t>>(ProtocolPP::field_t::PUBKEY, jarray<uint8_t>& fieldval)
std::shared_ptr<jarray<uint8_t>>PRVKEYset_field<std::shared_ptr<jarray<uint8_t>>>(ProtocolPP::field_t::PRVKEY, std::shared_ptr<jarray<uint8_t>>& fieldval)
std::shared_ptr<jarray<uint8_t>>PUBKEYset_field<std::shared_ptr<jarray<uint8_t>>>(ProtocolPP::field_t::PUBKEY, std::shared_ptr<jarray<uint8_t>>& fieldval)
Parameters
field- field to update the security association with
fieldval- value to update the security association with

◆ to_json()

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

Prints the protocol as an JSON object

Parameters
myjson- JSON object to print with
direction- randomization
indent- indentation for JSON output

Implements ProtocolPP::jsecass.

◆ to_xml()

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

Prints the protocol as an XML object

Parameters
myxml- XMLPrinter object to print with
direction- randomization

Implements ProtocolPP::jsecass.


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