Skip to content

Latest commit

 

History

History
 
 

sample_node

TOP | GIT | SAMPLE NODE SCRIPTS


SAMPLE NODE SCRIPTS

Here is sample node utility scripts using 'jsrsasign' module.

NOTE: From jsrsasign 6.0.0 (2016-Sep-11), please install "jsrsasign", "jsrsasign-util" and "commander" npm packages to use scripts here because codes using "fs" have been separated and moved into new "jsrsasign-util" package.

  1. jwtverify - JWT and JWS verification tool

This script is to verify JWT(JSON Web Token) or JWS(JSON Web Signature) for HMAC password or public key. using KJUR.jws.JWS.verifyJWT() method. See here in detail.

  1. asn1dump - simple ASN.1 dumper

This script dumps ASN.1 DER formatted binary file.

% asn1dump aaa.pub.p8.der
SEQUENCE
  SEQUENCE
    ObjectIdentifier rsaEncryption (1 2 840 113549 1 1 1)
    NULL
  BITSTRING 003081890...(total ???bytes)...
  1. jwssign - sign JWS by header and payload file or string

This script is to sign JWS(JSON Web Signature) for specified header and payload file or string using KJUR.jws.JWS.sign() method. See here in detail.

  1. pemtobin - convert any PEM file to binary

This script converts from any PEM format file to binary.

% pemtobin aaa.pem aaa.der

REQUIRED NPMS

To execute above scripts some npm packages are reuiqred:

% npm install -g commander
% npm install -g jsrsasign
% npm install -g jsrsasign-util