|
@@ -30,13 +30,20 @@ describe('key generation', (context) => {
|
30
|
30
|
next()
|
31
|
31
|
})
|
32
|
32
|
|
33
|
|
- context('encryptionKey(key)', (assert, next) => {
|
|
33
|
+ context('encryptionKey(string)', (assert, next) => {
|
34
|
34
|
const key = crypto.encryptionKey(crypto.randomBytes(32).toString('hex'))
|
35
|
35
|
assert.ok(key, 'Key successfully generated')
|
36
|
36
|
assert.ok(key instanceof Buffer, 'key is a secure buffer')
|
37
|
37
|
next()
|
38
|
38
|
})
|
39
|
39
|
|
|
40
|
+ context('encryptionKey(buffer)', (assert, next) => {
|
|
41
|
+ const key = crypto.encryptionKey(crypto.randomBytes(32))
|
|
42
|
+ assert.ok(key, 'Key successfully generated')
|
|
43
|
+ assert.ok(key instanceof Buffer, 'key is a secure buffer')
|
|
44
|
+ next()
|
|
45
|
+ })
|
|
46
|
+
|
40
|
47
|
context('accessKey()', (assert, next) => {
|
41
|
48
|
const accessKey = crypto.accessKey()
|
42
|
49
|
assert.ok(accessKey, 'Key successfully generated')
|