cytong-signature
v0.0.7
Published
signature of cytong api
Downloads
2
Readme
Cytong Signature
cytong sign package
Installation
npm install cytong-signature
Usage
reference:signature_test
Require
var signature = require('../lib/signature');
Sign
var sign = signature.sign("method=query-user&keyword=mike", PRIVATE_KEY);
var params = {"method": "query-user", "keyword": "mike"};
var sign = signature.signParams(params, PRIVATE_KEY);
Verify sign
var bCheck = signature.check("method=query-user&keyword=mike", sign, PUBLIC_KEY);
var params = {"method": "query-user", "keyword": "mike", sign: "T4vpCiQPrzKCOWNWo2FcSzn0ZO..."};
var bCheck = signature.checkParams(params, PUBLIC_KEY);
var json = '{"response":{"method":"query-user","keyword":"mike"},"sign":"Lu1wuEEhfxVNjpy90T..."}';
var bCheck = signature.checkJson(json, PUBLIC_KEY);