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

Public Member Functions

 jdsasa ()
 
 jdsasa (int bitsize, keymode_t mode)
 
 jdsasa (int bitsize, keymode_t mode, CryptoPP::Integer prime, CryptoPP::Integer subprime, CryptoPP::Integer generator)
 
 jdsasa (int bitsize, keymode_t mode, CryptoPP::DSA::PrivateKey prvkey, CryptoPP::DSA::PublicKey pubkey)
 
 jdsasa (jdsasa &rhs)
 standard copy constructor
 
 jdsasa (std::shared_ptr< jdsasa > &rhs)
 standard copy constructor from shared pointer
 
virtual ~jdsasa ()=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)
 
 jdsasa (const jdsasa &jdsasa)=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

◆ jdsasa() [1/4]

ProtocolPP::jdsasa::jdsasa ( )

Standard constructor with defaults

DSA Defaults
fieldDefault Value
bitsize3078
modekeymode_t::GENKEYPAIR
product0
quotient0
generator0
prvkey0
pubkey0

◆ jdsasa() [2/4]

ProtocolPP::jdsasa::jdsasa ( int  bitsize,
keymode_t  mode 
)

Security Association for DSA

Required fields for DSA

Parameters
bitsize- size of the private key (768:1024:2048:3078:4096:6172:8192)
mode- Direction of data flow (GENKEYPAIR:PKISIGN:PKIVERIFY)

◆ jdsasa() [3/4]

ProtocolPP::jdsasa::jdsasa ( int  bitsize,
keymode_t  mode,
CryptoPP::Integer  prime,
CryptoPP::Integer  subprime,
CryptoPP::Integer  generator 
)

Security Association for DSA

Required fields for DSA

Parameters
bitsize- size of the private key (768:1024:2048:3078:4096:6172:8192)
mode- Direction of data flow (GENKEYPAIR:PKISIGN:PKIVERIFY)
prime- Product (Prime) parameter for DSA field
subprime- Quotient (SubPrime) parameter for DSA field
generator- Generator parameter for DSA field

◆ jdsasa() [4/4]

ProtocolPP::jdsasa::jdsasa ( int  bitsize,
keymode_t  mode,
CryptoPP::DSA::PrivateKey  prvkey,
CryptoPP::DSA::PublicKey  pubkey 
)

Security Association for DSA

Required fields for DSA

Parameters
bitsize- size of the private key (768:1024:2048:3078:4096:6172:8192)
mode- Direction of data flow (GENKEYPAIR:PKISIGN:PKIVERIFY)
prvkey- Private DSA key
pubkey- Public DSA key

Member Function Documentation

◆ get_field()

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

Returns the version field of the DSA security association

DSA Get Fields
field typefield nameExample
intBITSIZEint bitsize = get_field<int>(field_t::BITSIZE)
keymode_tMODEkeymode_t mode = get_field<keymode_t>(field_t::MODE)
CryptoPP::Integer PRIMECryptoPP::Integer product = get_field<CryptoPP::Integer>(field_t::PRIME)
CryptoPP::Integer SUBPRIMECryptoPP::Integer quotient = get_field<CryptoPP::Integer>(field_t::SUBPRIME)
CryptoPP::Integer GENERATORCryptoPP::Integer generator = get_field<CryptoPP::Integer>(field_t::GENERATOR)
CryptoPP::DSA::PrivateKey PRVKEYCryptoPP::DSA::PrivateKey prvkey = get_field<CryptoPP::DSA::PrivateKey>(field_t::PRVKEY)
CryptoPP::DSA::PublicKey PUBKEYCryptoPP::DSA::PublicKey pubkey = get_field<CryptoPP::DSA::PublicKey>(field_t::PUBKEY)
std::pair<CryptoPP::DSA::PrivateKey,CryptoPP::DSA::PublicKey> KEYPAIRstd::pair<CryptoPP::DSA::PrivateKey,CryptoPP::DSA::PublicKey> kp = get_field<std::pair<CryptoPP::DSA::PrivateKey,CryptoPP::DSA::PublicKey>>(field_t::KEYPAIR)
Parameters
field- field to retrieve from the DSA security association
Returns
field of the DSA security association

◆ set_field()

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

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

DSA Set Fields
field typefield nameExample
intBITSIZEset_field<int>(field_t::BITSIZE, 3078)
keymode_tMODEset_field<keymode_t>(field_t::MODE, keymode_t::GENKEYPAIR)
CryptoPP::Integer PRIMEset_field<CryptoPP::Integer>(field_t::PRIME, product)
CryptoPP::Integer SUBPRIMEset_field<CryptoPP::Integer>(field_t::SUBPRIME, quotient)
CryptoPP::Integer GENERATORset_field<CryptoPP::Integer>(field_t::GENERATOR, generator)
CryptoPP::DSA::PrivateKey PRVKEYset_field<CryptoPP::DSA::PrivateKey>(field_t::PRVKEY, prvkey)
CryptoPP::DSA::PublicKey PUBKEYset_field<CryptoPP::DSA::PublicKey>(field_t::PUBKEY, pubkey)
Parameters
field- field to update the DSA security association
fieldval- value to update the DSA security association

◆ to_json()

void ProtocolPP::jdsasa::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::jdsasa::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: