|
pure virtual |
Key exchange between two parties requires each party to exchange their public keys.
Once this is done then the Diffie-Hellman algorithm can be used to compute the shared secret.
pPublicKey | [ in ] The peer's DH public key (obtained by the caller of this method - e.g., SSH protocol) |
keyLength | [ in ] Size in bytes of the data passed in by pPublicKey |
pSharedSecret | [ out ] The shared secret, (or key), that has been exchanged (i.e., both sides compute). If NULL, then the required size of a buffer to hold the shared secret is returned in pWritten. |
cBuffer | [ in ] Number of entries in the buffer pointed to by pSharedSecret. |
pWritten | [ out ] Optional can be NULL, returns the number of bytes written into pSharedSecret. This parameter cannot be NULL when pSharedSecret is also NULL. |
Success | P6R::eOk | |
Failure | eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eInvalidArg | If pPublicKey is NULL. If pSharedSecret and pWritten are both NULL. | |
P6R::eInvalidState | A call to genDHKeyPair() must be made before a call to this function. | |
P6R::eTooSmall | The buffer pointed to by pSharedSecret is not large enough to hold the key data. | |
P6R::eFailAndException | The shared secret calculation failed. Exception record provides detailed error info. |