keyAgreement

open suspend fun keyAgreement(privateKey: PrivateKey, peerPublicKey: ByteArray): ByteArray(source)

Diffie-Hellman: the shared secret of privateKey and peerPublicKey, in the raw encoding of the key's KeyType. For P-256 and P-384 that is an uncompressed SEC1 point 04 || x || y of KeyType.publicKeyLength bytes, and the result is the x-coordinate of the shared point (SEC 1 v2 §3.3.1). Callers expand compressed points with Sec1 first; a backend may accept them too, as DefaultCryptoBackend does, but need not.