How to use the hmac function from node-forge
Find comprehensive JavaScript node-forge.hmac code examples handpicked from public code repositorys.
GitHub: FOGProject/fog-core
![FOGProject profile picture](/FOGProject.png?size=40)
60 61 62 63 64 65 66 67 68 69
hash.file.sha512 = function(file, cb) { hashFile(forge.md.sha512.create(), file, cb); }; hash.hmac = function(type, key, data, cb) { var hmac = forge.hmac.create(); hmac.start(type, key); hashData(hmac, data, cb); }; hash.file.hmac = function(type, key, file, cb) {
+ 31 other calls in file
GitHub: ubiqsecurity/ubiq-node
48 49 50 51 52 53 54 55 56 57
const url = new URL(host); allHeaders.host = url.host; allHeaders['(created)'] = created; allHeaders.digest = digest; const headers = ['content-type', 'date', 'host', '(created)', '(request-target)', 'digest']; const hmac = forge.hmac.create(); hmac.start('sha512', sapi); for (let i = 0; i < headers.length; i++) { hmac.update(`${headers[i]}: ${allHeaders[headers[i]]}\n`); }
GitHub: y-kkky/dotfiles
381 382 383 384 385 386 387 388 389 390 391 392
}; keyczar_util._aesFromBytes = function(keyBytes, hmacBytes) { var aesObject = forge.aes.createEncryptionCipher(keyBytes); var mdObject = forge.md.sha1.create(); var hmacObject = forge.hmac.create(); hmacObject.start(mdObject, hmacBytes); // calculate the keyhash var md = forge.md.sha1.create();
node-forge.pki is the most popular function in node-forge (10287 examples)