Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

nkeys.KeyPair

import type { nkeys } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.27.0/nats-base-client/internal_mod.ts"; 

const { KeyPair } = nkeys;
interface KeyPair {
clear(): void;
getPrivateKey(): Uint8Array;
getPublicKey(): string;
getSeed(): Uint8Array;
sign(input: Uint8Array): Uint8Array;
verify(input: Uint8Array, sig: Uint8Array): boolean;
}
interface KeyPair {
clear(): void;
getPrivateKey(): Uint8Array;
getPublicKey(): string;
getSeed(): Uint8Array;
sign(input: Uint8Array): Uint8Array;
verify(input: Uint8Array, sig: Uint8Array): boolean;
}

§Methods

§
clear(): void
[src]

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

§
getPrivateKey(): Uint8Array
[src]

Returns the private key associated with the KeyPair

@return

Uint8Array

§
getPublicKey(): string
[src]

Returns the public key associated with the KeyPair

@return
§
getSeed(): Uint8Array
[src]

Returns the PrivateKey's seed.

@return

Uint8Array

§
sign(input: Uint8Array): Uint8Array
[src]

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

@param input
@return

Uint8Array

§
verify(input: Uint8Array, sig: Uint8Array): boolean
[src]

Returns true if the signature can be verified with the KeyPair

@param input
@param sig
@return

§Methods

§
clear(): void
[src]

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

§
getPrivateKey(): Uint8Array
[src]

Returns the private key associated with the KeyPair

@return

Uint8Array

§
getPublicKey(): string
[src]

Returns the public key associated with the KeyPair

@return
§
getSeed(): Uint8Array
[src]

Returns the PrivateKey's seed.

@return

Uint8Array

§
sign(input: Uint8Array): Uint8Array
[src]

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

@param input
@return

Uint8Array

§
verify(input: Uint8Array, sig: Uint8Array): boolean
[src]

Returns true if the signature can be verified with the KeyPair

@param input
@param sig
@return