tuweni / org.apache.tuweni.crypto.sodium / Box / forKeys

forKeys

static fun forKeys(receiver: PublicKey!, sender: SecretKey!): Box! (source)

Precompute the shared key for a given sender and receiver.

Note that the returned instance of Box should be closed using #close() (or try-with-resources) to ensure timely release of the shared key, which is held in native memory.

Parameters

receiver - PublicKey!: The public key of the receiver.

sender - SecretKey!: The secret key of the sender.

Return
Box!: A Box instance.