diffieHellman.setPrivateKey(privateKey[, encoding])
privateKey<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding<string>privateKey字符串的 编码。
设置 Diffie-Hellman 私钥。如果提供了 encoding 参数,privateKey 应为字符串。如果未提供 encoding,privateKey 应为 Buffer、TypedArray 或 DataView。
【Sets the Diffie-Hellman private key. If the encoding argument is provided,
privateKey is expected
to be a string. If no encoding is provided, privateKey is expected
to be a Buffer, TypedArray, or DataView.】
此功能不会自动计算关联的公钥。可以使用 diffieHellman.setPublicKey() 或 diffieHellman.generateKeys() 手动提供公钥,或自动生成公钥。
【This function does not automatically compute the associated public key. Either
diffieHellman.setPublicKey() or diffieHellman.generateKeys() can be
used to manually provide the public key or to automatically derive it.】