ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

A buffer looks like an object in js #97

Closed arj03 closed 2 years ago

arj03 commented 2 years ago

You can't current use verify if the signature is a buffer. This fixes that problem :)

davegomez commented 2 years ago

If the signature is a base 64 string, is the isObject the right validation here?

arj03 commented 2 years ago

@davegomez the idea is that if you are passing in an object instead of a string, you should rather use verifyObj. This function works with both string and buffer. It's just that in javascript typeof (buffer) == 'object' ;-)