basant307/AI_Governance_Project
048
1# ecdsa-sig-formatter2 3[](https://travis-ci.org/Brightspace/node-ecdsa-sig-formatter) [](https://coveralls.io/r/Brightspace/node-ecdsa-sig-formatter)4 5Translate between JOSE and ASN.1/DER encodings for ECDSA signatures6 7## Install8```sh9npm install ecdsa-sig-formatter --save10```11 12## Usage13```js14var format = require('ecdsa-sig-formatter');15 16var derSignature = '..'; // asn.1/DER encoded ecdsa signature17 18var joseSignature = format.derToJose(derSignature);19 20```21 22### API23 24---25 26#### `.derToJose(Buffer|String signature, String alg)` -> `String`27 28Convert the ASN.1/DER encoded signature to a JOSE-style concatenated signature.29Returns a _base64 url_ encoded `String`.30 31* If _signature_ is a `String`, it should be _base64_ encoded32* _alg_ must be one of _ES256_, _ES384_ or _ES512_33 34---35 36#### `.joseToDer(Buffer|String signature, String alg)` -> `Buffer`37 38Convert the JOSE-style concatenated signature to an ASN.1/DER encoded39signature. Returns a `Buffer`40 41* If _signature_ is a `String`, it should be _base64 url_ encoded42* _alg_ must be one of _ES256_, _ES384_ or _ES512_43 44## Contributing45 461. **Fork** the repository. Committing directly against this repository is47 highly discouraged.48 492. Make your modifications in a branch, updating and writing new unit tests50 as necessary in the `spec` directory.51 523. Ensure that all tests pass with `npm test`53 544. `rebase` your changes against master. *Do not merge*.55 565. Submit a pull request to this repository. Wait for tests to run and someone57 to chime in.58 59### Code Style60 61This repository is configured with [EditorConfig][EditorConfig] and62[ESLint][ESLint] rules.63 64[EditorConfig]: http://editorconfig.org/65[ESLint]: http://eslint.org66 