# @root/csr

> Lightweight, Zero-Dependency CSR (Certificate Signing Request) generator and parser for Node.js and Browsers

Latest version **0.8.1** (published 2019-10-16) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @root/csr
pnpm add @root/csr
yarn add @root/csr
bun add @root/csr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2019-10-16 |
| First published | 2019-10-08 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 91.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | AJ ONeal |
| Maintainers | coolaj86, thejshaver, turleybw |
| Keywords | CSR, ASN.1, DER, PEM, x509, RSA, EC, ECDSA, letsencrypt, ACME, asn1 |

## Links

- npm: https://www.npmjs.com/package/@root/csr
- Repository: https://git.rootprojects.org/root/csr.js
- npm.io page: https://npm.io/package/@root/csr

## Dependencies (3)

- [@root/pem](https://npm.io/package/@root/pem.md) ^1.0.4
- [@root/asn1](https://npm.io/package/@root/asn1.md) ^1.0.0
- [@root/x509](https://npm.io/package/@root/x509.md) ^0.7.2

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.8.1 (latest) — 2019-10-16
- 0.8.0 — 2019-10-15
- 1.0.0-wip.0 — 2019-10-08

## README

# @root/csr

Lightweight, Zero-Dependency CSR (Certificate Signing Request) generator and parser for Node.js and Browsers

# Usage

```js
var CSR = require('@root/csr');
var PEM = require('@root/pem/packer');

CSR.csr({
	jwk: jwk,
	domains: ['example.com', '*.example.com', 'foo.bar.example.com'],
	encoding: 'pem'
}).then(function(der) {
	var csr = PEM.packBlock({ type: 'CERTIFICATE REQUEST', bytes: der });
	console.log(csr);
});
```

```txt
-----BEGIN CERTIFICATE REQUEST-----
MIIBHjCBxQIBADAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTBZMBMGByqGSM49AgEG
CCqGSM49AwEHA0IABFL897BlwE6Tmco/r7LpwVL2BdDx12zZr+BnA/0/PjkI0lsu
013u1+X5fe6vKnOIjcb5obaFnSQixuMGu3qcVnmgTTBLBgkqhkiG9w0BCQ4xPjA8
MDoGA1UdEQQzMDGCC2V4YW1wbGUuY29tgg0qLmV4YW1wbGUuY29tghNmb28uYmFy
LmV4YW1wbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIADRCWsMYBjm70Hqi08QrOcR
Gcz8uJTe7vZwqOGtykWiAiEA1FTbMskZR9w2ugFWXkWfBdb1W6cD2v6nK+J0wj2r
Q48=
-----END CERTIFICATE REQUEST-----
```

# Advanced Usage

Create an unsigned request

```
var CSR = require('@root/csr');

// Note: this requires the public key to embed it in the request
var hex = CSR.request({
	jwk: jwk,
	domains: ['example.com', '*.example.com', 'foo.bar.example.com'],
  encoding: 'hex'
})
```

---
_Source: https://npm.io/package/@root/csr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
