fix: some issues found when using in libp2p-secio

This commit is contained in:
Friedel Ziegelmayer
2016-05-23 09:53:29 +02:00
committed by dignifiedquire
parent 1f4823e202
commit 18810aca86
4 changed files with 36 additions and 6 deletions

View File

@ -112,4 +112,26 @@ describe('RSA', () => {
})
})
})
it('sign and verify', () => {
const data = new Buffer('hello world')
const sig = key.sign(data)
expect(
key.public.verify(data, sig)
).to.be.eql(
true
)
})
it('does fails to verify for different data', () => {
const data = new Buffer('hello world')
const sig = key.sign(data)
expect(
key.public.verify(new Buffer('hello'), sig)
).to.be.eql(
false
)
})
})