Commit 4180b9752e30345f4c196c7dc8648334cf9b2913
createAuth method
Dominic Tarr committed on 3/6/2015, 8:45:58 PMParent: 5f9f193e1855719d8c60ef976a86474ce6be2779
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -227,4 +227,12 @@ | ||
227 | 227 | var str = JSON.stringify(obj, null, 2) |
228 | 228 | var _hmac = exports.hmac(str, secret) |
229 | 229 | return deepEqual(hmac, _hmac) |
230 | 230 | } |
231 | + | |
232 | +exports.createAuth = function (keys, role) { | |
233 | + return ssbKeys.signObj(keys, { | |
234 | + role: role || 'client', | |
235 | + ts: Date.now(), | |
236 | + public: keys.public | |
237 | + }) | |
238 | +} |
Built with git-ssb-web