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

    Function sign

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

      • privateKey: string | Buffer<ArrayBufferLike> | KeyObject

        The private key to sign the message with.

      • message: string | Buffer<ArrayBufferLike>

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

      • Optionalopts: IRsaOptions

        The options for signing, including the passphrase of the private key and the padding algorithm.

      Returns Buffer

      Return a Buffer that contains the signature of the payload.

      E_INVALID_PRIVATE_KEY If the private key is not a valid RSA private key.

      E_SIGN_FAILED If the signing fails.