sessionless-node
v0.11.0
Published
Node implementation of the sessionless protocol
Downloads
79
Readme
Sessionless
Sessionless is a multi-language implementation of public-key cryptography. It's trying to be like the cordless drill or sewing machine of authentication--a tool everyone can have in their house t o help them make things.
This is the node implementation of the Sessionless protocol--a protocol for providing auth without user data like emails, passwords, or sessions. For examples of various server implementations, please see here.
Usage
Start by installing sessionless-node:
npm i sessionless-node --save
sessionless-node provides both commonjs and esm modules so you can:
const sessionless = require('sessionless-node');
and
import sessionless from 'sessionless-node';
Sessionless-node provides six methods:
generateKeys(saveKeys, getKeys)
- generates a new key pair, and returns them to the caller. saveKeys and getKeys are functions sessionless-node will use to save keys, and get keys for signing.getKeys()
- calls thegetKeys
function passed togenerateKeys
sign(message)
- signs an arbitrary message with the saved private keyverifySignature(signature, message, pubKey)
- returns true if the passed in public key verifies the signature of the passed in message.generateUUID()
- generates and returns a new uuidassociate(primarySignature, primaryMessage, primaryPublicKey, secondarySignature, secondaryMessage, secondaryPublicKey)
- a convenience method provided for associating keys together. For more on associating keys check out this section of the dev README.
For more info, check out the docs in the repo.