Documents for @litert/signatures
    Preparing search index...

    Function createSigner

    • Create a new ECDSA signer instance.

      Parameters

      • hashAlgo:
            | "sha1"
            | "sha224"
            | "sha256"
            | "sha3-224"
            | "sha3-256"
            | "sha3-384"
            | "sha3-512"
            | "sha384"
            | "sha512"

        The hash/digest algorithm to use.

      • publicKey: null | string | Buffer<ArrayBufferLike> | KeyObject = null

        The public key to use for verification, or null to create a signer without a public key.

      • privateKey: null | string | Buffer<ArrayBufferLike> | KeyObject = null

        The private key to use for signing, or null to create a verifier without a private key.

      • Optionalopts: IEcdsaOptions

        Optional options for the signer, such as key passphrase.

      Returns ISigner

      A new ECDSA signer instance.

      E_NO_KEY_PROVIDED If neither publicKey nor privateKey is provided.

      E_INVALID_PUBLIC_KEY If the provided public key is invalid or not of type 'ec'.

      E_INVALID_PRIVATE_KEY If the provided private key is invalid or not of type 'ec'.

      E_KEY_TYPE_MISMATCH If the types of the key pair do not match.