1.2.1 • Published 5 years ago
raidden v1.2.1
Raidden
Sometimes a padlock is enough!
A bunker is not always necessary to control access, or to hide content. A padlock can be much more practical and simple to use.
Raidden was made with this idea, being simple, light, and easy to use.
Installation
npm install raidden
or
yarn add raidden
How to use
- Create Keys
- Create a Keychain
Create a Padlock
import { KeyChain, Key, PadLock } from 'raidden';
const adminKey = new Key("my-secret-admin-string-key");
const userKey = new Key("my-user-string-key");
const anonKey = new Key("my-anon-string-key");
const loggedInKeychain = new KeyChain([adminKey, userKey]);
const loggedInPadlock = new PadLock(loggedInKeychain);
- Use key to check
loggedInPadlock.canUnlock(adminKey); // true
loggedInPadlock.canUnlock(userKey);
// true
loggedInPadlock.canUnlock(anonKey);
// false