Skip to content

TAPPGuild/bitjws-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitjws-js

A javascript library for bitjws

Install

Bower: bower install bitjws-js NPM: npm install bitjws-js

Methdos

signSerialize(url, payload, sign, expTime)

Return a signed JWT message. By default the expiration claim (exp) is set to one hour in the future and the issued at claim (iat) is the current unix timestamp * 1000.

validateDeserialize(url, raw, checkExpiration)

Verify a signed JWT message and return its header and payload if the signature matches.

deriveKeys(username, password, iters, salt)

Generate a salt and derive keys based on the username and password given. PBKDF2-HMAC-SHA256 is used for key stretching with a default iteration count of 10000.

recoverKeys(mnemonic)

Produce keys for encrypting, signing requests, and generating wallets from the given words using BIP39. The encrypting key corresponds to the key derived at m/0', the signing key (and the respective public address) at m/1', and m/2' for the wallet gen key which is expected to be further derived for each wallet belonging to the same user.

keyToBuffer(key)

Convert data stored as a sequence of 8 elements composed of 4 bytes each to a sequence of bytes as a Buffer.

checkBytes(data)

Return the last 6 hexadecimal digits from SHA256(data).

wifToPriv(wif)

Convert a wif string address to a private key string.

privToWif(priv)

Convert a private key string to a wif string address.

Develop

Run: grunt dev and do your stuff.

Build

Run: grunt build

Test

Run: npm test and the test will run over the dist files.

About

Javascript library for bitjws authentication, signing and verification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published