jsrsasign
Pure JavaScript cryptography library for RSA/ECDSA/DSA signing, X.509 certificates, ASN.1, JWS/JWT, and CMS.
Repository Health
Technical Analysis
jsrsasign is a long-running, pure-JavaScript cryptography library first released in 2010 that implements a very wide swath of PKI and signing primitives without native bindings: RSA/RSA-PSS/ECDSA/DSA key generation and signing, ASN.1 encoding/decoding, PKCS#1/5/8 key formats, X.509 certificate and CSR (PKCS#10) generation and parsing, CRL and OCSP handling, RFC 3161 timestamping, CMS SignedData/PKCS#7, CAdES, and the full JOSE stack (JWS, JWT, JWK). It works in both browsers and Node.js, making it a common choice for client-side certificate/CSR generation and JWT signing where native crypto bindings aren’t available.
The project’s maintainer announced end of support effective 3 June 2026 and deprecated the npm package, so it is no longer actively maintained going forward — but the source remains fully open (MIT licensed) on GitHub, the code is stable after 16 years of production use, and its extremely broad feature coverage means it is still widely depended upon in existing codebases for PKI operations that have no equally complete pure-JS replacement.
What You Get
- RSA, RSA-PSS, ECDSA, and DSA key generation, signing, and signature verification
- X.509 certificate and CSR (PKCS#10) generation and parsing, plus CRL and OCSP request/response handling
- A full JOSE implementation: JWS (JSON Web Signature), JWT (JSON Web Token), and JWK (JSON Web Key)
- ASN.1 encoding/decoding utilities (
asn1-1.0.js,asn1hex-1.1.js) underlying all the certificate and signature formats - CMS SignedData/PKCS#7 and CAdES support, plus RFC 3161 timestamp token generation and verification
Common Use Cases
- Generating a CSR and private key entirely client-side in the browser before submitting to a CA
- Signing or verifying JWTs in environments without access to Node’s native
cryptomodule (e.g. legacy browser code) - Parsing and inspecting X.509 certificate fields, extensions, and CRLs in a pure-JS toolchain
- Building CMS/CAdES digital-signature workflows or RFC 3161 timestamping into a document-signing pipeline
Under The Hood
Architecture — The library is organized as a large collection of versioned single-purpose modules under src/ (e.g. asn1-1.0.js, asn1x509-1.0.js, rsasign-1.2.js, ecdsa-modified-1.0.js, jws-3.3.js, keyutil-1.0.js), each implementing one cryptographic primitive or encoding layer, which are concatenated into distribution bundles (jsrsasign-all-min.js, jsrsasign-rsa-min.js, jsrsasign-jwths-min.js) for different use-case footprints; the npm package (published from the npm/ subdirectory) wraps these bundles behind a single lib/jsrsasign.js entry point. Tech Stack — Written in pre-ES6 JavaScript style reflecting its 2010 origin (the README notes ES2015+ features like Promise/let/class were only introduced starting with the 11.0.0 release), with zero runtime dependencies; tests use Mocha (npm/test/) covering signing, key utilities, and base64x encoding. Code Quality — 80+ files under test/ provide broad coverage of signature algorithms, ASN.1 encoding, and JWS/JWT handling built up over 16 years of production use and a documented CVE/security-advisory history (noted in the README), though development activity has slowed sharply since the 2026 end-of-support announcement. API Design — The API predates modern JS idioms — functions are grouped under large single-purpose classes (KEYUTIL, X509, KJUR.crypto) rather than small composable modules, and correct usage often requires consulting the project’s wiki/API reference rather than discovering it via autocomplete, giving it a steeper learning curve than newer crypto libraries.
Used by 6 apps in this directory
Element Web
Team Chat · Collaboration
A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.
MentraOS
Developer Tools · AI Development
The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.
Rocket.Chat
Team Chat
The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.
RSSHub
Automation · Social Media
Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.
Supabase
Developer Tools · Databases · Search
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Wire
Team Chat · Video Conferencing · Collaboration
Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.