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

Public Member Functions

 jrsasa ()
 
 jrsasa (int bitsize, keymode_t mode, rsapadtype_t padtype, rsaenc_t enc)
 
 jrsasa (int bitsize, keymode_t mode, rsapadtype_t padtype, rsaenc_t enc, CryptoPP::RSA::PrivateKey prvkey, CryptoPP::RSA::PublicKey pubkey)
 
 jrsasa (jrsasa &rhs)
 standard copy constructor
 
 jrsasa (std::shared_ptr< jrsasa > &rhs)
 standard copy constructor from shared pointer
 
virtual ~jrsasa ()=default
 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)
 
 jrsasa (const jrsasa &jrsasa)=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

◆ jrsasa() [1/3]

ProtocolPP::jrsasa::jrsasa ( )

Standard constructor with defaults

RSA Defaults
fieldDefault Value
bitsize3078
modekeymode_t::GENKEYPAIR
padtypersapadtype_t::PKCS15
encrsaenc_t::PKCS
prvkey0
pubkey0

◆ jrsasa() [2/3]

ProtocolPP::jrsasa::jrsasa ( int  bitsize,
keymode_t  mode,
rsapadtype_t  padtype,
rsaenc_t  enc 
)

Security Association for RSA

Required fields for RSA

Parameters
bitsize- size of the private key (768:1024:2048:3078:4096:6172:8192)
mode- Type of PKI calculation (GENKEYPAIR:PKISIGN:PKIVERIFY:RSAENCRYPT:RSADECRYPT)
padtype- PKCS15 or PSS
enc- PKCS or OAEP_SHA

◆ jrsasa() [3/3]

ProtocolPP::jrsasa::jrsasa ( int  bitsize,
keymode_t  mode,
rsapadtype_t  padtype,
rsaenc_t  enc,
CryptoPP::RSA::PrivateKey  prvkey,
CryptoPP::RSA::PublicKey  pubkey 
)

Security Association for RSA

Required fields for RSA

Parameters
bitsize- size of the private key (768:1024:2048:3078:4096:6172:8192)
mode- Type of PKI calculation (GENKEYPAIR:PKISIGN:PKIVERIFY:RSAENCRYPT:RSADECRYPT)
padtype- PKCS15 or PSS
enc- PKCS or OAEP_SHA
prvkey- Private RSA key
pubkey- Public RSA key

Member Function Documentation

◆ get_field()

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

Returns the version field of the RSA security association

RSASA Get Fields
field typefield nameExample
intBITSIZEint bitsize = get_field<int>(field_t::BITSIZE)
keymode_tMODEkeymode_t mode = get_field<keymode_t>(field_t::MODE)
rsapadtype_tPADTYPErsapadtype_t padtype = get_field<rsapadtype_t>(field_t::PADTYPE)
rsaenc_tENCrsaenc_t rsaenc = get_field<rsaenc_t>(field_t::ENC)
CryptoPP::RSA::PrivateKey PRVKEYCryptoPP::RSA::PrivateKey prvkey = get_field<CryptoPP::RSA::PrivateKey>(field_t::PRVKEY)
CryptoPP::RSA::PublicKey PUBKEYCryptoPP::RSA::PublicKey pubkey = get_field<CryptoPP::RSA::PublicKey>(field_t::PUBKEY)
Parameters
field- field to retrieve from the RSA security association
Returns
field of the RSA security association

◆ set_field()

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

Allows the user to update the field of the RSA security association

RSASA Set Fields
field typefield nameExample
intBITSIZEset_field<int>(field_t::BITSIZE, 3078)
keymode_tMODEset_field<keymode_t>(field_t::MODE, keymode_t::GENKEYPAIR)
rsapadtype_tPADTYPEset_field<rsapadtype_t>(field_t::PADTYPE, rsapadtype_t::PKCS15)
rsaenc_tENCset_field<rsaenc_t>(field_t::ENC, rsaenc_t::PKCS)
CryptoPP::RSA::PrivateKey PRVKEYset_field<CryptoPP::RSA::PrivateKey>(field_t::PRVKEY, prvkey)
CryptoPP::RSA::PublicKey PUBKEYset_field<CryptoPP::RSA::PublicKey>(field_t::PUBKEY, pubkey)
Parameters
field- field to update in the RSA security association
fieldval- value to update in the RSA security association

◆ to_json()

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

Prints the protocol object in JSON

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

Implements ProtocolPP::jsecass.

◆ to_xml()

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

Prints the protocol object in XML

Parameters
myxml- XMLPrinter object to print to
direction- randomzation

Implements ProtocolPP::jsecass.


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