[Pkg-javascript-commits] [node-keygrip] 10/68: added that keys are stored in a closure
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Fri Jun 27 22:13:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to branch master
in repository node-keygrip.
commit a9690c25fc63796a7b8bf3b186fc1ad77ac67e80
Author: Jed Schmidt <tr at nslator.jp>
Date: Fri Feb 25 19:09:24 2011 +0900
added that keys are stored in a closure
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2e837ab..327a62d 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Keygrip is a [node.js](http://nodejs.org/) module for signing and verifying data
### keys = new Keygrip([ keylist ])
-This creates a new Keygrip based on the provided keylist, an array of secret keys used for SHA1 HMAC digests. Keygrip keeps a reference to this array to automatically reflect any changes. If no list is given, or the list is empty, Keygrip uses the default key created during `npm` installation, and will issue a warning to the console.
+This creates a new Keygrip based on the provided keylist, an array of secret keys used for SHA1 HMAC digests. If no list is given, or the list is empty, Keygrip uses the default key created during `npm` installation, and will issue a warning to the console.
Note that the `new` operator is also optional, so all of the following will work when `Keygrip = require( "keygrip" )`:
@@ -29,6 +29,8 @@ The keylist is an array of all valid keys for signing, in descending order of fr
The tradeoff here is that adding more keys to the keylist allows for more granular freshness for key validation, at the cost of a more expensive worst-case scenario for old or invalid hashes.
+Keygrip keeps a reference to this array to automatically reflect any changes. This reference is stored using a closure to prevent external access.
+
### keys.sign( data )
This creates a SHA1 HMAC based on the _first_ key in the keylist, and outputs it as a 27-byte url-safe base64 digest (base64 without padding, replacing `+` with `-` and `/` with `_`).
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-keygrip.git
More information about the Pkg-javascript-commits
mailing list