deno.com

method DiffieHellman.prototype.computeSecret

Overload 1

#DiffieHellman.prototype.computeSecret(
otherPublicKey: ArrayBufferView,
inputEncoding?: null,
outputEncoding?: null,
): Buffer

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 the specified inputEncoding, and secret is encoded using specified outputEncoding. If the inputEncoding is not provided, otherPublicKey is expected to be a Buffer, TypedArray, or DataView.

If outputEncoding is given a string is returned; otherwise, a Buffer is returned.

Parameters #

#otherPublicKey: ArrayBufferView
optional
#inputEncoding: null

The encoding of an otherPublicKey string.

optional
#outputEncoding: null

The encoding of the return value.

Return Type #

Buffer

Overload 2

#DiffieHellman.prototype.computeSecret(
otherPublicKey: string,
inputEncoding: BinaryToTextEncoding,
outputEncoding?: null,
): Buffer

Parameters #

#otherPublicKey: string
#inputEncoding: BinaryToTextEncoding
optional
#outputEncoding: null

Return Type #

Buffer

Overload 3

#DiffieHellman.prototype.computeSecret(
otherPublicKey: ArrayBufferView,
inputEncoding: null,
outputEncoding: BinaryToTextEncoding,
): string

Parameters #

#otherPublicKey: ArrayBufferView
#inputEncoding: null
#outputEncoding: BinaryToTextEncoding

Return Type #

string

Overload 4

#DiffieHellman.prototype.computeSecret(
otherPublicKey: string,
inputEncoding: BinaryToTextEncoding,
outputEncoding: BinaryToTextEncoding,
): string

Parameters #

#otherPublicKey: string
#inputEncoding: BinaryToTextEncoding
#outputEncoding: BinaryToTextEncoding

Return Type #

string