jsrsasign
opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK)
Last updated 2 months ago by kjur .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jsrsasign 
SYNC missed versions from official npm registry.

jsrsasign

license bower npm version npm downloads jsdeliver downloads CDNJS githubsponsors cryptocurrency

jsrsasign TOP | github | Wiki | DOWNLOADS | TUTORIALS | API REFERENCE | Online Tool | DEMO | NODE TOOL | AddOn | DONATE

The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES JSON Web Signature/Token/Key in pure JavaScript.

Public page is https://kjur.github.io/jsrsasign .

Your bugfix and pull request contribution are always welcomed :)

NOTICE FOR COMMING 11.0.0 RELEASE

The "jsrsasign" library is a long lived JavaScript library from 2010 developed with old JavaScript style and backword compatibility. From coming release 11.0.0, following are planed and suport them gradually:

  • Stop to support Internet Explorer.
  • Stop to support bower.
  • Modern ECMA functions will be introduced such as Promise, let, Array methods or class.
  • API document generator will be changed from Jsdoc Toolkit to JSDoc3.
  • Module bandler will be used such as browserify or webpack.
  • Not to use YUI compressor.
  • Unit test framework will be changed from QUnit and mocha to jest.
  • W3C Web Crypto API support.
  • split into some modules besides jsrsasign have been all in package before 11.0.0.

NEWS

  • 2023-Mar-12: 10.7.0 Release. Now supports custom X.509 extension and custom OIDs by new "Add-on" architecture. (See here in detail)
  • 2021-Nov-21: 10.5.0 Release. Now supports secp521r1(P-521) ECDSA.
  • 2021-Apr-14: Security advisory and update for CVE-2021-30246 RSA signature validation vulnerability published
  • 2020-Oct-05: jsrsasign won Google Open Source Peer Bonus Award. Thank you Google.
  • 2020-Sep-23: 10.0.0 released for CMS SignedData related class including timestamp and CAdES architecture update
  • 2020-Aug-24: 9.1.0 released to new CRL APIs align with certificate
  • 2020-Aug-19: 9.0.0 released for major update of certificate and CSR generation and parsing without backward compatibility. Please see migration guide in detail.
  • 2020-Aug-02: twitter account @jsrsasign started for announcement. please follow.

HIGHLIGHTS

  • Swiss Army Knife style all in one package crypto and PKI library
  • available on Node.js and browsers
  • Long live open source software from 2010
  • very easy API to use
  • powerful various format key loader and ASN.1 API
  • rich document and samples
  • no dependency to other library
  • no dependency to W3C Web Cryptography API nor OpenSSL
  • no dependency on newer ECMAScirpt function. So old browsers also supported.
  • very popular crypto library with 1M+ npm downloads/month
  • supports "Add-on" architecture

INSTALL

Node NPM

> npm install jsrsasign jsrsasign-util

Bower

> bower install jsrsasign

Or include in HTML from many CDN sites

> <script src="https://cdnjs.cloudflare.com/ajax/libs/jsrsasign/8.0.20/jsrsasign-all-min.js"></script>

USAGE

Loading encrypted PKCS#5 private key:

> var rs = require('jsrsasign');
> var rsu = require('jsrsasign-util');
> var pem = rsu.readFile('z1.prv.p5e.pem');
> var prvKey = rs.KEYUTIL.getKey(pem, 'passwd');

Sign string 'aaa' with the loaded private key:

> var sig = new a.Signature({alg: 'SHA1withRSA'});
> sig.init(prvKey);
> sig.updateString('aaa');
> var sigVal = sig.sign();
> sigVal
'd764dcacb...'

MORE TUTORIALS AND SAMPLES

RECENT SECURITY ADVISORY

published fixed version title/advisory CVE CVSS
2022Jun24 10.5.25 JWS and JWT signature validation vulnerability with special characters CVE-2022-25898 ?
2021Apr14 10.2.0 RSA signature validation vulnerability on maleable encoded message CVE-2021-30246 9.1
2020Jun22 8.0.19 ECDSA signature validation vulnerability by accepting wrong ASN.1 encoding CVE-2020-14966 5.5
2020Jun22 8.0.18 RSA RSAES-PKCS1-v1_5 and RSA-OAEP decryption vulnerability with prepending zeros CVE-2020-14967 4.8
2020Jun22 8.0.17 RSA-PSS signature validation vulnerability by prepending zeros CVE-2020-14968 4.2

Here is full published security advisory list.

DONATIONS

If you like jsrsasign and my other project, you can support their development by donation through any of the platform/services below. Thank you as always.

Github Sponsors

You can sponsor jsrsasign with the GitHub Sponsors program.

Cryptocurrency

You can donate cryptocurrency to jsrsasign using the following addresses:

Current Tags

  • 11.1.1                                ...           latest (2 months ago)

152 Versions

  • 11.1.1                                ...           2 months ago
  • 11.1.0                                ...           2 years ago
  • 11.0.0                                ...           2 years ago
  • 10.9.0                                ...           2 years ago
  • 10.8.6                                ...           3 years ago
  • 10.8.5                                ...           3 years ago
  • 10.8.4                                ...           3 years ago
  • 10.8.3                                ...           3 years ago
  • 10.8.2                                ...           3 years ago
  • 10.8.1                                ...           3 years ago
  • 10.8.0                                ...           3 years ago
  • 10.7.0                                ...           3 years ago
  • 10.6.1                                ...           3 years ago
  • 10.6.0                                ...           3 years ago
  • 10.5.27                                ...           4 years ago
  • 10.5.26                                ...           4 years ago
  • 10.5.25                                ...           4 years ago
  • 10.5.24                                ...           4 years ago
  • 10.5.23                                ...           4 years ago
  • 10.5.22                                ...           4 years ago
  • 10.5.21 [deprecated]           ...           4 years ago
  • 10.5.20                                ...           4 years ago
  • 10.5.19                                ...           4 years ago
  • 10.5.18                                ...           4 years ago
  • 10.5.17                                ...           4 years ago
  • 10.5.16                                ...           4 years ago
  • 10.5.15                                ...           4 years ago
  • 10.5.14                                ...           4 years ago
  • 10.5.13                                ...           4 years ago
  • 10.5.12                                ...           4 years ago
  • 10.5.11                                ...           4 years ago
  • 10.5.10                                ...           4 years ago
  • 10.5.9                                ...           4 years ago
  • 10.5.8                                ...           4 years ago
  • 10.5.7                                ...           4 years ago
  • 10.5.6                                ...           4 years ago
  • 10.5.5                                ...           4 years ago
  • 10.5.4                                ...           4 years ago
  • 10.5.3                                ...           4 years ago
  • 10.5.2                                ...           4 years ago
  • 10.5.1                                ...           4 years ago
  • 10.5.0                                ...           4 years ago
  • 10.4.1                                ...           5 years ago
  • 10.4.0                                ...           5 years ago
  • 10.3.2                                ...           5 years ago
  • 10.3.0                                ...           5 years ago
  • 10.2.0                                ...           5 years ago
  • 10.1.13                                ...           5 years ago
  • 10.1.12                                ...           5 years ago
  • 10.1.11                                ...           5 years ago
  • 10.1.10                                ...           5 years ago
  • 10.1.9                                ...           5 years ago
  • 10.1.8                                ...           5 years ago
  • 10.1.7 [deprecated]           ...           5 years ago
  • 10.1.6 [deprecated]           ...           5 years ago
  • 10.1.5                                ...           5 years ago
  • 10.1.4                                ...           5 years ago
  • 10.1.3                                ...           5 years ago
  • 10.1.2                                ...           5 years ago
  • 10.1.1                                ...           5 years ago
  • 10.1.0                                ...           5 years ago
  • 10.0.5                                ...           5 years ago
  • 10.0.4                                ...           5 years ago
  • 10.0.3                                ...           5 years ago
  • 10.0.2                                ...           5 years ago
  • 10.0.1                                ...           5 years ago
  • 10.0.0                                ...           6 years ago
  • 9.1.9                                ...           6 years ago
  • 9.1.8                                ...           6 years ago
  • 9.1.7                                ...           6 years ago
  • 9.1.6                                ...           6 years ago
  • 9.1.5                                ...           6 years ago
  • 9.1.4                                ...           6 years ago
  • 9.1.3                                ...           6 years ago
  • 9.1.2                                ...           6 years ago
  • 9.1.1                                ...           6 years ago
  • 9.1.0                                ...           6 years ago
  • 9.0.3                                ...           6 years ago
  • 9.0.2                                ...           6 years ago
  • 9.0.1                                ...           6 years ago
  • 9.0.0                                ...           6 years ago
  • 8.0.24                                ...           6 years ago
  • 8.0.23                                ...           6 years ago
  • 8.0.22                                ...           6 years ago
  • 8.0.21                                ...           6 years ago
  • 8.0.20                                ...           6 years ago
  • 8.0.19                                ...           6 years ago
  • 8.0.18                                ...           6 years ago
  • 8.0.17                                ...           6 years ago
  • 8.0.16                                ...           6 years ago
  • 8.0.15                                ...           6 years ago
  • 8.0.14                                ...           6 years ago
  • 8.0.13                                ...           6 years ago
  • 8.0.12                                ...           8 years ago
  • 8.0.11                                ...           8 years ago
  • 8.0.10                                ...           8 years ago
  • 8.0.9                                ...           8 years ago
  • 8.0.8                                ...           8 years ago
  • 8.0.7                                ...           8 years ago
  • 8.0.6                                ...           8 years ago
  • 8.0.5                                ...           8 years ago
  • 8.0.4                                ...           9 years ago
  • 8.0.3                                ...           9 years ago
  • 8.0.2                                ...           9 years ago
  • 8.0.1                                ...           9 years ago
  • 8.0.0                                ...           9 years ago
  • 7.2.2                                ...           9 years ago
  • 7.2.1                                ...           9 years ago
  • 7.2.0                                ...           9 years ago
  • 7.1.5                                ...           9 years ago
  • 7.1.3                                ...           9 years ago
  • 7.1.2                                ...           9 years ago
  • 7.1.1                                ...           9 years ago
  • 7.1.0                                ...           9 years ago
  • 7.0.0                                ...           9 years ago
  • 6.2.3                                ...           9 years ago
  • 6.2.2                                ...           9 years ago
  • 6.2.1                                ...           9 years ago
  • 6.2.0                                ...           9 years ago
  • 6.1.4                                ...           9 years ago
  • 6.1.3                                ...           9 years ago
  • 6.1.2                                ...           10 years ago
  • 6.1.1                                ...           10 years ago
  • 6.1.0                                ...           10 years ago
  • 6.0.1                                ...           10 years ago
  • 6.0.0                                ...           10 years ago
  • 5.1.0                                ...           10 years ago
  • 5.0.15                                ...           10 years ago
  • 5.0.14                                ...           10 years ago
  • 5.0.13                                ...           10 years ago
  • 5.0.12                                ...           10 years ago
  • 5.0.11                                ...           10 years ago
  • 5.0.10                                ...           10 years ago
  • 5.0.9                                ...           10 years ago
  • 5.0.8                                ...           10 years ago
  • 5.0.7                                ...           10 years ago
  • 5.0.6                                ...           10 years ago
  • 5.0.5                                ...           10 years ago
  • 5.0.2                                ...           10 years ago
  • 5.0.1                                ...           10 years ago
  • 5.0.0                                ...           10 years ago
  • 4.9.2                                ...           11 years ago
  • 4.9.1                                ...           11 years ago
  • 4.9.0                                ...           11 years ago
  • 4.8.6                                ...           11 years ago
  • 4.8.5                                ...           11 years ago
  • 4.8.4                                ...           11 years ago
  • 4.8.3                                ...           11 years ago
  • 4.8.2                                ...           11 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 88
Last Month 88
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |