0.1.0-alpha.0 • Published 2 years ago
@botcomet/auth v0.1.0-alpha.0
@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');
}
0.1.0-alpha.0
2 years ago