阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js crypto ecdh.computeSecret

      Node.js crypto ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])版本历史

      版本变更
      v10.0.0Changed error format to better support invalid public key error
      v6.0.0The default inputEncoding changed from binary to utf8
      v0.11.14新增于: v0.11.14
      • otherPublicKey < string> | < Buffer> | < TypedArray> | < DataView>
      • inputEncoding < string> The encoding of the otherPublicKey string.
      • outputEncoding < string> The encoding of the return value.
      • Returns: < Buffer> | < string>

      Computes the shared secret using otherPublicKey as the other party’s public key and returns the computed shared secret. The supplied key is interpreted using specified inputEncoding, and the returned secret is encoded using the specified outputEncoding. If the inputEncoding is not provided, otherPublicKey is expected to be a Buffer, TypedArray, or DataView.

      If outputEncoding is given a string will be returned; otherwise a Buffer is returned.

      ecdh.computeSecret will throw an ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY error when otherPublicKey lies outside of the elliptic curve. Since otherPublicKey is usually supplied from a remote user over an insecure network, its recommended for developers to handle this exception accordingly.


      更多内容请参考:Node.js crypto 加密,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录