@did-btc1/key-pair
    Preparing search index...

    Interface IPrivateKey

    Interface for the PrivateKey class. IPrivateKey

    interface IPrivateKey {
        bytes: Bytes;
        hex: Hex;
        point: bigint;
        secret: bigint;
        computePublicKey(): PublicKey;
        equals(other: PrivateKey): boolean;
        isValid(): boolean;
        json(): PrivateKeyJSON;
    }

    Implemented by

    Index

    Properties

    bytes: Bytes

    Get the private key bytes.

    hex: Hex

    Get the private key as a hex string.

    point: bigint

    Get the private key point.

    secret: bigint

    Getter returns the private key bytes in secret form. Setter allows alternative method of using a bigint secret to genereate the private key bytes.

    Methods

    • Uses the private key to compute the corresponding public key.

      Returns PublicKey

      A new PublicKey object.

      PrivateKeyUtils.computePublicKey

    • Checks if this private key is equal to another private key.

      Parameters

      Returns boolean

      True if the private keys are equal.

    • Checks if the private key is valid.

      Returns boolean

      Whether the private key is valid.

    • JSON representation of a PrivateKey object.

      Returns PrivateKeyJSON

      The PrivateKey as a JSON object.