How to use the hmac function from node-forge

Find comprehensive JavaScript node-forge.hmac code examples handpicked from public code repositorys.

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) {
fork icon4
star icon4
watch icon16

+ 31 other calls in file

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`);
}
fork icon0
star icon4
watch icon0

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();
fork icon0
star icon0
watch icon0