/** * @license * @preserve * * KeeeX SAS Public code * https://keeex.me * Copyright 2013-2023 KeeeX All Rights Reserved. * * These computer program listings and specifications, herein, * are and remain the property of KeeeX SAS. The intellectual * and technical concepts herein are proprietary to KeeeX SAS * and may be covered by EU and foreign patents, * patents in process, trade secrets and copyright law. * * These listings are published as a way to provide third party * with the ability to process KeeeX data. * As such, support for public inquiries is limited. * They are provided "as-is", without warrany of any kind. * * They shall not be reproduced or copied or used in whole or * in part as the basis for manufacture or sale of items unless * prior written permission is obtained from KeeeX SAS. * * For a license agreement, please contact: * * */ import { Secp256k1Keypair } from "../secp256k1/keypair.js"; import * as keyPair from "../shared/keypair.js"; import { KeyType } from "../shared/types.js"; import BitcoinFormatter from "./formatter.js"; import * as btcTypes from "./types.js"; import type * as btcIoTypes from "./iotypes.js"; import type { LocalTypeData } from "../shared/localdata.js"; export interface CreateParams { config?: btcTypes.BitcoinKeyConfiguration; ecKeypair?: Secp256k1Keypair; address?: string; formatterInstance?: BitcoinFormatter; } /** Bitcoin-type keypair. */ export default class BitcoinKeypair extends keyPair.Keypair { #private; private constructor(); static createInstance(params: CreateParams): Promise; static generateRandom(localType?: string | LocalTypeData): Promise; static import(data: btcIoTypes.ImportData): Promise; /** Extract the key used to compute a digital signature */ static signaturePubKey(data: string | Uint8Array, signature: string | Uint8Array, messageFormat?: btcTypes.MessageFormat, formatter?: BitcoinFormatter): Promise<{ pubKey: Uint8Array; compressed: boolean; }>; /** Similar to signaturePubKey() but expect data to be formatted */ static signaturePubKeyRaw(data: Uint8Array, signature: Uint8Array): { pubKey: Uint8Array; compressed: boolean; }; getPrivateRaw: () => Uint8Array; getPublicRaw(): Uint8Array; getLocalTypeRaw(): LocalTypeData; deriveKey(secondParty: keyPair.IKeypair): Uint8Array; convertToRaw(keyType: KeyType): Promise; exportKey(publicOnly: boolean, options: btcIoTypes.ExportOptions): Promise; canSign: () => boolean; /** Sign a message */ signRaw(data: Uint8Array): Uint8Array; /** Verify that a signature matches a key */ verifyRaw(data: Uint8Array, signature: Uint8Array): Promise; protected getSignaturePlaceholderLength(): number; }