UNPKG

@funded-labs/plug-controller

Version:

Internet Computer Plug wallet's controller

39 lines (38 loc) 1.42 kB
import { PublicKey, Signature } from '@dfinity/agent'; import { GenericSignIdentity } from '../genericSignIdentity'; import Secp256k1PublicKey from './publicKey'; import { JsonnableKeyPair } from './../../../interfaces/identity'; declare class Secp256k1KeyIdentity extends GenericSignIdentity { protected _privateKey: ArrayBuffer; static fromParsedJson(obj: JsonnableKeyPair): Secp256k1KeyIdentity; static fromJSON(json: string): Secp256k1KeyIdentity; static fromKeyPair(publicKey: ArrayBuffer, privateKey: ArrayBuffer): Secp256k1KeyIdentity; static fromSecretKey(secretKey: ArrayBuffer): Secp256k1KeyIdentity; protected _publicKey: Secp256k1PublicKey; protected constructor(publicKey: Secp256k1PublicKey, _privateKey: ArrayBuffer); /** * Serialize this key to JSON. */ toJSON(): JsonnableKeyPair; /** * Return a copy of the key pair. */ getKeyPair(): { secretKey: ArrayBuffer; publicKey: Secp256k1PublicKey; }; /** * Return the public key. */ getPublicKey(): PublicKey; /** * Return private key in a pem file */ getPem(): string; /** * Signs a blob of data, with this identity's private key. * @param challenge - challenge to sign with this identity's secretKey, producing a signature */ sign(challenge: ArrayBuffer): Promise<Signature>; } export default Secp256k1KeyIdentity;