git ssb

1+

Dominic / ssb-keys



Tree: 68df1eba527e24ae3645414bbadd9f374f16d524

Files: 68df1eba527e24ae3645414bbadd9f374f16d524 / test / fs.js

713 bytesRaw
1var tape = require('tape')
2var ssbkeys = require('../')
3var crypto = require('crypto')
4var path = '/tmp/ssb-keys_'+Date.now()
5var fs = require('fs')
6
7tape('create and load presigil-legacy async', function (t) {
8
9 var keys = ssbkeys.generate('ed25519')
10 keys.id = keys.id.substring(1)
11 fs.writeFileSync(path, JSON.stringify(keys))
12
13 var k2 = ssbkeys.loadSync(path)
14 t.equal(k2.id, '@' + keys.id)
15 t.end()
16
17})
18
19tape('create and load presigil-legacy', function (t) {
20
21 var keys = ssbkeys.generate('ed25519')
22 keys.id = keys.id.substring(1)
23 fs.writeFileSync(path, JSON.stringify(keys))
24
25 ssbkeys.load(path, function (err, k2) {
26 if(err) throw err
27 t.equal(k2.id, '@' + keys.id)
28 t.end()
29 })
30
31})
32
33

Built with git-ssb-web