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

    Function createSigner

    • Create a new EDDSA signer instance.

      Parameters

      • 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.

      • keyType: null | "ed25519" | "ed448" = null

        The key algorithm to use, or null to use the algorithm of the key.

      • Optionalopts: IEddsaOptions

        Optional options for the signer, such as key passphrase.

      Returns ISigner

      A new EDDSA 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 'ed25519' or 'ed448'.

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

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