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
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | Object is in an incorrect state. |
P6R::eInvalidArg | pRandom is NULL. |
P6R::eFailAndException | The prime calculation failed. Exception record provides detailed error info. |