crypto.diffieHellman(options[, callback])


根据 privateKeypublicKey 计算 Diffie-Hellman 共享密钥。两把密钥必须具有相同的 asymmetricKeyType,并且必须支持 DH 或 ECDH 操作。

🌐 Computes the Diffie-Hellman shared secret based on a privateKey and a publicKey. Both keys must have the same asymmetricKeyType and must support either the DH or ECDH operation.

如果提供了 callback 函数,该函数会使用 libuv 的线程池。

🌐 If the callback function is provided this function uses libuv's threadpool.