Generates the shared secret, and places it into the buffer
sharedSecret, beginning at offset inclusive.
If the sharedSecret buffer is too small to hold the
result, a ShortBufferException is thrown.
In this case, this call should be repeated with a larger output buffer.
This method resets this KeyAgreementSpi object,
so that it
can be reused for further key agreements. Unless this key agreement is
reinitialized with one of the engineInit methods, the same
private information and algorithm parameters will be used for
subsequent key agreements.
sharedSecret | the buffer for the shared secret | |
offset | the offset in sharedSecret where the
shared secret will be stored |
sharedSecret
IllegalStateException | if this key agreement has not been completed yet | |
ShortBufferException | if the given output buffer is too small to hold the secret |
Diagram: KeyManagement