温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/crypto/ECDH/computeSecret
点击访问原文链接

ECDH.computeSecret method | Node.js crypto module | Bun

ECDH.computeSecret method | Node.js crypto module | BunBuildDocsReferenceGuidesBlogDiscord/node:crypto/ECDH/computeSecretMcomputeSecret

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:crypto/ECDH/computeSecretMcomputeSecret

method

crypto.ECDH.computeSecretcomputeSecret(otherPublicKey: ArrayBufferView): NonSharedBuffer;

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 anERR_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, be sure to handle this exception accordingly.

computeSecret(otherPublicKey: string,inputEncoding: BinaryToTextEncoding): NonSharedBuffer;

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 anERR_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, be sure to handle this exception accordingly.

@param inputEncoding

The encoding of the otherPublicKey string.

computeSecret(otherPublicKey: ArrayBufferView,outputEncoding: BinaryToTextEncoding): 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 anERR_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, be sure to handle this exception accordingly.

@param outputEncoding

The encoding of the return value.

computeSecret(otherPublicKey: string,inputEncoding: BinaryToTextEncoding,outputEncoding: BinaryToTextEncoding): 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 anERR_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, be sure to handle this exception accordingly.

@param inputEncoding

The encoding of the otherPublicKey string.

@param outputEncoding

The encoding of the return value.

Referenced typestype BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

ECDH.computeSecret method | Node.js crypto module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method node:crypto.ECDH.computeSecret | Bun