Translate ECDSA signatures between ASN.1/DER and JOSE-style concatenation formats. Version 1.0.11 is the latest stable version; the package is rarely updated but widely depended on by libraries like jsonwebtoken. It converts DER-encoded signatures (common in OpenSSL, crypto libraries) to the concatenated r||s format used by JWT/JOSE standards (ES256, ES384, ES512), and vice versa. It handles base64 encoding/decoding and works with Buffer or string input. Implements no crypto logic itself, only format translation.
npm install ecdsa-sig-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates converting DER-encoded ECDSA signature to JOSE format and back using derToJose and joseToDer.
Ensure alg is one of the supported JOSE algorithm names.
Use appropriate base64 encoding before passing string arguments.
Validate the input signature format before calling these functions.
For new projects, evaluate if this dependency is necessary; prefer native Web Crypto API or comprehensive JWT libraries.
Use only 'ES256', 'ES384', or 'ES512' as the second argument.
Ensure the signature is either a Buffer or a string (base64 or base64url encoded).
Ensure the string is base64 encoded (without padding or with padding) before passing to derToJose. For joseToDer, the string should be base64url encoded.
Convert Uint8Array to Buffer first: Buffer.from(uint8Array).
No dependency data recorded yet.