ejwt
v0.1.0
Published
Encrypted JSON webtokens
Downloads
30
Readme
Encrypted JSON Webtoken Issuer Server
Issuer service for encrypted JSON Webtokens that provides a HTTP and HTTPS server to get and renew webtokens.
Installation
You can use npm
npm install ejwt
or clone this repository.
Usage
Sign token
tokenissuer = require('ejwt')({
"sign_key" : fs.readFileSync(PATH_TO_PRIVATE_KEY),
"verify_certificate" : fs.readFileSync(PATH_TO_PUBLIC_KEY),
"encryption_key" : YOUR_ENCRYPTION_PASSPHRASE,
"expires" : EXPIRATION_TIME,
"algorithm" : ALGORITHM (default RS256)
});
tokenissuer.sign({YOUR_DATA_OBJECT});
Verify token / get token data
tokenissuer.verify(ENCRYPTED_TOKEN, function(err,data){
if(err)
...
else
...
});```