ECDH.generateKeys method | Node.js crypto module | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
ECDH/
generateKeysMgenerateKeys
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
ECDH/
generateKeysMgenerateKeys
method
crypto.ECDH.generateKeysgenerateKeys(): NonSharedBuffer;
Generates private and public EC Diffie-Hellman key values, and returns the public key in the specified format and encoding. This key should be transferred to the other party.
The format argument specifies point encoding and can be 'compressed' or 'uncompressed'. If format is not specified, the point will be returned in'uncompressed' format.
If encoding is provided a string is returned; otherwise a Buffer is returned.
generateKeys(encoding:
BinaryToTextEncoding,format?:
ECDHKeyFormat): string;
Generates private and public EC Diffie-Hellman key values, and returns the public key in the specified format and encoding. This key should be transferred to the other party.
The format argument specifies point encoding and can be 'compressed' or 'uncompressed'. If format is not specified, the point will be returned in'uncompressed' format.
If encoding is provided a string is returned; otherwise a Buffer is returned.
@param encoding
The encoding of the return value.
Referenced typestype
BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'type
ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →