Creates the shared secret and returns it as a secret key object of the requested algorithm type.
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.
algorithm | the requested secret key algorithm |
IllegalStateException | if this key agreement has not been completed yet | |
NoSuchAlgorithmException | if the requested secret key algorithm is not available | |
InvalidKeyException | if the shared secret key material cannot be used to generate a secret key of the requested algorithm type (e.g., the key material is too short) |
Diagram: KeyManagement