Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class DiffieHellman
import { DiffieHellman } from "https://deno.land/std@0.172.0/node/internal/crypto/diffiehellman.ts";

Constructors

new
DiffieHellman(
sizeOrKey: unknown,
keyEncoding?: unknown,
generator?: unknown,
genEncoding?: unknown,
)

Properties

verifyError: number

Methods

computeSecret(otherPublicKey: ArrayBufferView): Buffer
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer
computeSecret(otherPublicKey: ArrayBufferView, outputEncoding: BinaryToTextEncoding): string
computeSecret(
otherPublicKey: string,
inputEncoding: BinaryToTextEncoding,
outputEncoding: BinaryToTextEncoding,
): string
getPrime(encoding: BinaryToTextEncoding): string
setPrivateKey(privateKey: ArrayBufferView): void
setPrivateKey(privateKey: string, encoding: BufferEncoding): void
setPublicKey(publicKey: ArrayBufferView): void
setPublicKey(publicKey: string, encoding: BufferEncoding): void