PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@hashgraph/cryptography/lib

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

/**
 * @typedef {object} KeyPair
 * @property {Uint8Array} publicKey
 * @property {Uint8Array} privateKey
 */
export default class EcdsaPrivateKey {
    /**
     * Generate a random ECDSA private key.
     *
     * @returns {EcdsaPrivateKey}
     */
    static generate(): EcdsaPrivateKey;
    /**
     * Generate a random Ed25519 private key.
     *
     * @returns {Promise<EcdsaPrivateKey>}
     */
    static generateAsync(): Promise<EcdsaPrivateKey>;
    /**
     * Construct a private key from bytes.
     *
     * @param {Uint8Array} data
     * @returns {EcdsaPrivateKey}
     */
    static fromBytes(data: Uint8Array): EcdsaPrivateKey;
    /**
     * Construct a private key from bytes.
     *
     * @param {Uint8Array} data
     * @returns {EcdsaPrivateKey}
     */
    static fromBytesDer(data: Uint8Array): EcdsaPrivateKey;
    /**
     * Construct a private key from bytes.
     *
     * @param {Uint8Array} data
     * @returns {EcdsaPrivateKey}
     */
    static fromBytesRaw(data: Uint8Array): EcdsaPrivateKey;
    /**
     * Construct a private key from a hex-encoded string.
     *
     * @param {string} text
     * @returns {EcdsaPrivateKey}
     */
    static fromString(text: string): EcdsaPrivateKey;
    /**
     * Construct a private key from a hex-encoded string.
     *
     * @param {string} text
     * @returns {EcdsaPrivateKey}
     */
    static fromStringDer(text: string): EcdsaPrivateKey;
    /**
     * Construct a private key from a hex-encoded string.
     *
     * @param {string} text
     * @returns {EcdsaPrivateKey}
     */
    static fromStringRaw(text: string): EcdsaPrivateKey;
    /**
     * @hideconstructor
     * @internal
     * @param {KeyPair} keyPair
     * @param {(Uint8Array)=} chainCode
     */
    constructor(keyPair: KeyPair, chainCode?: (Uint8Array) | undefined);
    /**
     * @type {KeyPair}
     * @readonly
     * @private
     */
    private readonly _keyPair;
    /**
     * @type {?Uint8Array}
     * @readonly
     */
    readonly _chainCode: Uint8Array | null;
    /**
     * @returns {string}
     */
    get _type(): string;
    /**
     * Get the public key associated with this private key.
     *
     * The public key can be freely given and used by other parties to verify
     * the signatures generated by this private key.
     *
     * @returns {EcdsaPublicKey}
     */
    get publicKey(): EcdsaPublicKey;
    /**
     * Sign a message with this private key.
     *
     * @param {Uint8Array} bytes
     * @returns {Uint8Array} - The signature bytes without the message
     */
    sign(bytes: Uint8Array): Uint8Array;
    /**
     * @returns {Uint8Array}
     */
    toBytesDer(): Uint8Array;
    /**
     * @returns {Uint8Array}
     */
    toBytesRaw(): Uint8Array;
}
export type KeyPair = {
    publicKey: Uint8Array;
    privateKey: Uint8Array;
};
import EcdsaPublicKey from "./EcdsaPublicKey.js";

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


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