阿西河

所有教程

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

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js crypto.privateEncrypt

      Node.js crypto.privateEncrypt(privateKey, buffer)

      新增于: v1.1.0

      • privateKey < Object> | < string>
        • key < string> A PEM encoded private key.
        • passphrase < string> An optional passphrase for the private key.
        • padding <crypto.constants> An optional padding value defined in crypto.constants, which may be: crypto.constants.RSA_NO_PADDING or crypto.constants.RSA_PKCS1_PADDING.
      • buffer < Buffer> ||
      • Returns: < Buffer> A new Buffer with the encrypted content.

      Encrypts buffer with privateKey. The returned data can be decrypted using the corresponding public key, for example using crypto.publicDecrypt().

      privateKey can be an object or a string. If privateKey is a string, it is treated as the key with no passphrase and will use RSA_PKCS1_PADDING.


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


      目录
      本文目录
      目录