PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@dfinity/identity/lib/cjs/identity

Просмотр файла: ed25519.d.ts

import { DerEncodedPublicKey, KeyPair, PublicKey, Signature, SignIdentity } from '@dfinity/agent';
export declare class Ed25519PublicKey implements PublicKey {
    #private;
    /**
     * Construct Ed25519PublicKey from an existing PublicKey
     * @param {unknown} maybeKey - existing PublicKey, ArrayBuffer, DerEncodedPublicKey, or hex string
     * @returns {Ed25519PublicKey} Instance of Ed25519PublicKey
     */
    static from(maybeKey: unknown): Ed25519PublicKey;
    static fromRaw(rawKey: ArrayBuffer): Ed25519PublicKey;
    static fromDer(derKey: DerEncodedPublicKey): Ed25519PublicKey;
    private static RAW_KEY_LENGTH;
    private static derEncode;
    private static derDecode;
    get rawKey(): ArrayBuffer;
    get derKey(): DerEncodedPublicKey;
    private constructor();
    toDer(): DerEncodedPublicKey;
    toRaw(): ArrayBuffer;
}
/**
 * Ed25519KeyIdentity is an implementation of SignIdentity that uses Ed25519 keys. This class is used to sign and verify messages for an agent.
 */
export declare class Ed25519KeyIdentity extends SignIdentity {
    #private;
    /**
     * Generate a new Ed25519KeyIdentity.
     * @param seed a 32-byte seed for the private key. If not provided, a random seed will be generated.
     * @returns Ed25519KeyIdentity
     */
    static generate(seed?: Uint8Array): Ed25519KeyIdentity;
    static fromParsedJson(obj: JsonnableEd25519KeyIdentity): Ed25519KeyIdentity;
    static fromJSON(json: string): Ed25519KeyIdentity;
    static fromKeyPair(publicKey: ArrayBuffer, privateKey: ArrayBuffer): Ed25519KeyIdentity;
    static fromSecretKey(secretKey: ArrayBuffer): Ed25519KeyIdentity;
    protected constructor(publicKey: PublicKey, privateKey: ArrayBuffer);
    /**
     * Serialize this key to JSON.
     */
    toJSON(): JsonnableEd25519KeyIdentity;
    /**
     * Return a copy of the key pair.
     */
    getKeyPair(): KeyPair;
    /**
     * Return the public key.
     */
    getPublicKey(): Required<PublicKey>;
    /**
     * 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>;
    /**
     * Verify
     * @param sig - signature to verify
     * @param msg - message to verify
     * @param pk - public key
     * @returns - true if the signature is valid, false otherwise
     */
    static verify(sig: ArrayBuffer | Uint8Array | string, msg: ArrayBuffer | Uint8Array | string, pk: ArrayBuffer | Uint8Array | string): boolean;
}
declare type PublicKeyHex = string;
declare type SecretKeyHex = string;
export declare type JsonnableEd25519KeyIdentity = [PublicKeyHex, SecretKeyHex];
export {};

Выполнить команду


Для локальной разработки. Не используйте в интернете!