0.1.0-alpha.0 • Published 2 years ago

@botcomet/auth v0.1.0-alpha.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@botcomet/auth

This package contains functions to authenticate Comets and Plugins. It is used internally by BotComet.

Installation

npm install @botcomet/auth

Usage

import { Padlock, Certificate } from '@botcomet/auth';

const padlock = new Padlock(publicKey);
const cert = new Certificate(publicKey, privateKey);


let test = 'test';
test = padlock.lock(test);
test = certificate.unlock(test);
if (!padlock.verify(test)) {
  throw new Error('Invalid signature');
}