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

    Function verify

    • Verify a message with the specified hash/digest algorithm.

      Parameters

      • algo:
            | "md5"
            | "ripemd160"
            | "sha1"
            | "sha224"
            | "sha256"
            | "sha3-224"
            | "sha3-256"
            | "sha3-384"
            | "sha3-512"
            | "sha384"
            | "sha512"

        The hash/digest algorithm to use.

      • publicKey: string | Buffer<ArrayBufferLike> | KeyObject

        The public key to verify the message with.

      • message: string | Buffer<ArrayBufferLike>

        The payload to be verified, can be a Buffer or a string.

      • signature: Buffer

        The signature of the payload to be verified, must be a Buffer.

      • Optionalopts: IRsaOptions

        The options for verification, including the padding algorithm.

      Returns boolean

      Return true if the signature is valid, otherwise false.

      E_INVALID_PUBLIC_KEY If the public key is not a valid RSA public key.

      E_VERIFY_FAILED If the verification fails.