Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
interface nkeys.KeyPair
import { type nkeys } from "https://deno.land/x/natsws@v1.28.0/src/nats-base-client.ts";
const { KeyPair } = nkeys;

Methods

getPublicKey(): string

Returns the public key associated with the KeyPair

getPrivateKey(): Uint8Array

Returns the private key associated with the KeyPair

getSeed(): Uint8Array

Returns the PrivateKey's seed.

sign(input: Uint8Array): Uint8Array

Returns the digital signature of signing the input with the the KeyPair's private key.

verify(input: Uint8Array, sig: Uint8Array): boolean

Returns true if the signature can be verified with the KeyPair

clear(): void

Clears the secret stored in the keypair. After clearing a keypair cannot be used or recovered.

Methods

getPublicKey(): string

Returns the public key associated with the KeyPair

getPrivateKey(): Uint8Array

Returns the private key associated with the KeyPair

getSeed(): Uint8Array

Returns the PrivateKey's seed.

sign(input: Uint8Array): Uint8Array

Returns the digital signature of signing the input with the the KeyPair's private key.

verify(input: Uint8Array, sig: Uint8Array): boolean

Returns true if the signature can be verified with the KeyPair

clear(): void

Clears the secret stored in the keypair. After clearing a keypair cannot be used or recovered.