ns_hmac - Returns a string containing a keyed-hash message authentication code (HMAC)
These functions return a keyed-hash message authentication code (HMAC) for the specified key and message, using the specified message digest algorithm. An HMAC is a message authentication code of a key (secret) with a message. It may be used to simultaneously verify both the data integrity and the authentication of a message. For details of HMAC, consult RFC 4231.
The provided commands provide a one-step interface and an incremental interface, where the latter one can be used to incrementally compute a HMAC e.g. by reading data from a file. This is especially important for computing a HMAC on content which is too large to be kept in memory.
The listed commands are available in installations when NaviServer is compiled with OpenSSL support and where the NSF package is installed.
key Secret in the HMAC computation.
message Data from which the HMAC is to be computed.
key Secret in the HMAC computation
filename Path of a file containing the data from which the HMAC is to be computed. The file is read incrementally. args Optional paths to other files to be processed. The resulting HMAC is calculated cumulatively.
Create and return a new HMAC object for incremental operations. The option -digest defaults to "sha256" the option -key has to be always specified.
Add data incrementally to the HMAC object, which was created previously with ns_hmac new.
Return the current HMAC value from the HMAC object, to which data was added previously with the method add.
Delete the HMAC object (used for incremental operations).
nscp 2> ns_hmac string -digest sha256 "Jefe" "what do ya want for nothing?" 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843