FEATURES
The 'jsrsasign' library provides following features in pure JavaScript.- Signature - RSA/RSAPSS/ECDSA/DSA digital signtature class wrapper of Java JCE style
- MessageDigest - cryptographic hash calculation class wrapper of Java JCE style
- MAC - message authentication code hash calculation class wrapper of Java JCE style
- ASN.1 encoder/generator
- ASN.1 structure for X.509 ceritificate and CRL generation
- simple ASN.1 data parser
- simple X.509 certificate parser/reader
- KEYUTIL - loading RSA/EC/DSA private/public key from PEM formatted PKCS#1/5/8 and X.509 certificate
- Supported formats and algorithms are listed here.
NEWS
- 2013-Oct-12:
- Release 4.2.1 is now available.
- Add generic PEM private/public key exporting method KEYUTIL.getPEM and it provides support to export to PEM PKCS#8 encrypted private key.
- 2013-Oct-07:
- Node.js npm module of jsrsasign is now registered in the repository. It also includes 'jsjws'.
- 2013-Oct-06:
- Release 4.2.0 is now available.
- DSA/ECDSA algorithms is now supported most of class and methods like Signature, KEYUTIL, KJUR.asn1.x509 DSA
- KJUR.asn1.x509.X509Util.newCertPEM method to provide easy issuance of a certificate by JSON data.
- 2013-Oct-02:
- Release 4.1.6 is now available.
- DSA signature algorithm support (However Signature and KEYUTIL class don't support yet)
- KEYUTIL.generateKeypair method added
- ASN1Util.jsonToASN1HEX method added
- HmacSHA384 support
- 2013-Sep-23:
- Release 4.1.3 is now available.
- ASNUtil.newObject update for tagged object
- PKCS5PKEY class was moved to KEYUTIL class and KEYUTIL class has more generic getKey() method.
- 2013-Sep-12:
- Release 4.1.2 is now available.
- new ASNUtil.newObject method for easy ASN.1 Object generation. Please see API document and test codes for usage.
- Minimized all in one code jsrsasign-4.1.2-all-min.js is also provided.
- 2013-Aug-25:
- Release 4.1.0 is now available.
- RSAPSS support in Signature class.
- add useful init() method for Signature class
- add ECDSA support and getKey methods to PKCS5PKEY class
- 2013-Aug-17:
- Release 4.0.5 is now available.
- Message authentication code (MAC) class added.
- 2013-Jul-23:
- Release 4.0.2 is now available.
- RSAPSS signing and validation fix by Davegithub.com/davedoesdev)
- 2013-Jul-18:
- Release 4.0.0 is now available.
- ECC key generation and ECDSA signing and verification support
- Currently supports secp256r1, secp256k1 and secp384r1 curves
- You can specify other curves such like secp192r1 or NIST P-521 however it can't be signed nor verified properly with other curves. I appreciate if you fix the bugs.
- 2013-May-29:
- Release 3.1.3 is now available.
- Stanford JavaScript Crypto Library support in MessageDigest class.
- 2013-May-27:
- Release 3.1.2 is now available.
- add some methods to 'pkcs5pkey.js' to load encrypted PKCS#8 PEM private key.
- 2013-May-20:
- Release 3.1.1 is now available.
- add some methods to 'pkcs5pkey.js' to generate encrypted PKCS#5 PEM private key.
- 2013-May-16:
- Release 3.1.0 is now available.
- CRL class added to issue CRL.
ONLINE TOOL & DEMO
- Sample Application for ECDSA signing with JavaScript(NEW!!!)
- Sample Application for RSA signing with JavaScript
DOWNLOAD
- Use git to clonse the official jsrsasign repository
git clone git://github.com/kjur/jsrsasign.git
- Alternatively, you can download a zip file for the latest development version or a previous releases.
SOURCE CODES
The 'jsrsasign' library contains following source codes.
- asn1.js - ASN.1 DER primitive encoder class. (mini)
- asn1x509.js - ASN.1 structured for X.509 certificate. (mini)
- crypto.js - MessageDigest and Signature class like Java JCE. (mini)
- pkcs5pkey.js - encrypted PKCS#5 private key reader. (mini)
- rsasign.js - RSAKey class extension for RSA signing and verification. (mini)
- x509.js - X509 class to read subject public key from a PEM formatted X.509 certificate. (mini)
- rsapem.js - RSAKey class extension to read PKCS#1 RSA private key PEM file (mini)
- asn1hex.js - simple ASN.1 parser to read hexadecimal encoded ASN.1 DER (mini)
- ecdsa-modified.js - modified version of BitcoinJS ECDSA codes (mini)
- ecparam.js - ECC parameters (mini)
API DOCUMENT
The 'jsrsasign'(RSA-Sign JavaScript Library) JavaScript API document is available here.LICENSE
The 'jsrsasign'(RSA-Sign JavaScript Library) is licensed under the terms of the MIT license reproduced which is simple and easy to understand and places almost no restrictions.PROGRAMMING TUTORIALS
- MessageDigest class tutorial
- Signature class tutorial
- ASN1 DER Primitive Encoder tutorial
- ASN.1 structure classes for X.509 certificate tutorial
- Reading PKCS#5 RSA private key with password tutorial
- Signing and verifying with RSAKey extension (*DEPRECATED*)
- List of programming tutorials
MY RELATED PROJECT
PROJECTS THAT USE JSRSASIGN
- jwcrypto
- JavaScript implementation of JWS, JWT and JWC. The jycrypto is also used by Mozilla BrowserID/Persona. (used here)
- jwt-js
- JSON Web Tokens implemented in pure JavaScript. (used here)
- npm node-bignumber
- A pure javascript implementation of BigIntegers and RSA crypto for Node.js (used here)
- npm bignumber-jt
- A pure javascript implementation of BigIntegers and RSA crypto. (used here)
- NDN.JS
- a JavaScript client library for Named Data Networking of Univ. of Memphis. (used here)
- cryptio
- An easy-to-use encryption system utilizing RSA and AES for javascript. (used here)
- jspackcrx
- Package Chrome extension files using pure JavaScript. (used here)
- xml-signer
- xmldsig signatures in a browser (used here)
DEPENDENCY
- Tom Wu's jsbn library - BigInteger, RSA and ECC
- BitcoinJS library - ECDSA signature algorithm
- CryptoJS - symmetric key encryption algorithms, message digest, message authentication codes and PBKDF
- OpenPGP.js - DSA signature algorithm
- Yahoo YUI library - for class inheritance