Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hazae41/x509

Zero-copy X.509 certificates for the web 🏎️
https://github.com/hazae41/x509

asn1 certificate certificate-authority decoding der encoding esmodules javascript letsencrypt nodejs parser pem ssl tls typescript unit-testing x509 zero-copy

Last synced: 3 months ago
JSON representation

Zero-copy X.509 certificates for the web 🏎️

Awesome Lists containing this project

README

        



```bash
npm i @hazae41/x509
```

[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/x509)

## Features

### Current features
- 100% TypeScript and ESM
- Zero-copy reading and writing
- No external dependency
- No cryptography
- Rust-like patterns
- Zero-copy PEM <=> DER <=> ASN1 <=> X509 reading and writing
- X.509 certificates (v3)
- X.501 encoding and decoding

### [Upcoming features](https://github.com/sponsors/hazae41)
- X.509 extensions (v3)

## Usage

### Reading DER

```typescript
import { Certificate, X509 } from "@hazae41/x509";

const bytes = await readFile("./cert.der")
const cert = X509.tryReadFromBytes(bytes, Certificate).unwrap()
```

### Reading PEM

```typescript
import { PEM, Certificate, X509 } from "@hazae41/x509";

const bytes = PEM.tryParse(await readFile("./cert.pem", "utf8")).unwrap()
const cert = X509.tryReadFromBytes(bytes, Certificate).unwrap()
```