Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IDHKeyExchange::generatePrime ( P6UINT32  primeLength,
P6UINT32  generator,
p6IRandom pRandom 
)
pure virtual

Generate a prime to be used in a Diffie-Hellman algorithm of prime length in bits.

The generated prime can be tested to see if it is safe by a call to the checkPrime() method. The generated prime can be copied out by a call to the getPrime() method (and could then be passed into the genDHKeyPair() method via the DH_RAW key type).

Parameters
primeLength[ in ] The size of the prime (in bits) to generate (e.g., 1024).
generator[ in ] The generator to be used for the prime (typically 2 or 5).
pRandom[ in ] A standard crypto random component.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedObject is in an incorrect state.
P6R::eInvalidArgpRandom is NULL.
P6R::eFailAndExceptionThe prime calculation failed. Exception record provides detailed error info.