index.js 609 B

12345678910111213141516171819202122
  1. /*global exports*/
  2. var SignStream = require('./lib/sign-stream');
  3. var VerifyStream = require('./lib/verify-stream');
  4. var ALGORITHMS = [
  5. 'HS256', 'HS384', 'HS512',
  6. 'RS256', 'RS384', 'RS512',
  7. 'PS256', 'PS384', 'PS512',
  8. 'ES256', 'ES384', 'ES512'
  9. ];
  10. exports.ALGORITHMS = ALGORITHMS;
  11. exports.sign = SignStream.sign;
  12. exports.verify = VerifyStream.verify;
  13. exports.decode = VerifyStream.decode;
  14. exports.isValid = VerifyStream.isValid;
  15. exports.createSign = function createSign(opts) {
  16. return new SignStream(opts);
  17. };
  18. exports.createVerify = function createVerify(opts) {
  19. return new VerifyStream(opts);
  20. };