Commit bb67911fcc0812000fcd96fbcabf11ef9d29a48b
test sign and verify
Dominic Tarr committed on 5/28/2015, 8:06:19 PMParent: 4a7f18b92164ae999f72c2edcdebf98a06b763c8
Files changed
test/index.js | changed |
test/index.js | ||
---|---|---|
@@ -25,4 +25,19 @@ | ||
25 | 25 | t.equal(k1.private.toString('hex'), k2.private.toString('hex')) |
26 | 26 | t.equal(k1.public.toString('hex'), k2.public.toString('hex')) |
27 | 27 | t.end() |
28 | 28 | }) |
29 | + | |
30 | + | |
31 | +tape('sign and verify', function (t) { | |
32 | + | |
33 | + var keys = ssbkeys.generate() | |
34 | + var msg = ssbkeys.hash("HELLO THERE?") | |
35 | + var sig = ssbkeys.sign(keys, msg) | |
36 | + console.log('public', keys.public) | |
37 | + console.log('sig', sig) | |
38 | + t.ok(sig) | |
39 | + t.ok(ssbkeys.verify(keys, sig, msg)) | |
40 | + | |
41 | + t.end() | |
42 | + | |
43 | +}) |
Built with git-ssb-web