Methods used for creating digital signatures within a mutable user record on a USwarm-based DHT.
npm install @dwebid/sign
Call the exported function to get a dwebsign
instance.
Use this method to generate an assymetric keypair.
Returns an object with { publicKey, secretKey }
, both of which hold Buffers.
Create a signature for the user record
Options:
keypair
- REQUIRED, usekeypair
to generatedk
- REQUIRED, the key to the identity documentseq
- OPTIONAL, default0
. The sequence number of the value
Returns a concatenated Buffer of the username, dk and seq that is used by the sign() method.