# @hazae41/x509

> Zero-copy X.509 certificates in pure modern TypeScript

Latest version **1.2.14** (published 2025-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hazae41/x509
pnpm add @hazae41/x509
yarn add @hazae41/x509
bun add @hazae41/x509
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.14 |
| Published | 2025-08-15 |
| First published | 2022-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 227.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | hazae41 |
| Maintainers | hazae41 |
| Keywords | x509, pem, certificates, encoding, decoding, buffer, bytes, packets, stream, encoder, decoder, parsing, parser, asn1, der, ber, typescript, esmodules, tested, unit-tested |

## Links

- npm: https://www.npmjs.com/package/@hazae41/x509
- Repository: https://github.com/hazae41/x509
- Issues: https://github.com/hazae41/x509/issues
- npm.io page: https://npm.io/package/@hazae41/x509

## Dependencies (4)

- [@hazae41/asn1](https://npm.io/package/@hazae41/asn1.md) ^1.3.35
- [@hazae41/base16](https://npm.io/package/@hazae41/base16.md) ^2.0.2
- [@hazae41/base64](https://npm.io/package/@hazae41/base64.md) ^2.0.2
- [@hazae41/binary](https://npm.io/package/@hazae41/binary.md) ^1.3.11

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.2.14 (latest) — 2025-08-15
- 1.2.13 — 2025-08-15
- 1.2.12 — 2025-08-15
- 1.2.11 — 2025-08-15
- 1.2.10 — 2024-09-01
- 1.2.9 — 2024-09-01
- 1.2.8 — 2024-03-11
- 1.2.7 — 2024-03-11
- 1.2.6 — 2023-11-30
- 1.2.5 — 2023-11-15
- 1.2.4 — 2023-11-14
- 1.2.3 — 2023-11-14
- 1.2.2 — 2023-11-14
- 1.2.1 — 2023-11-13
- 1.2.0 — 2023-11-07
- … 42 more at https://npm.io/package/@hazae41/x509/versions

## README

<div align="center">
<img  src="https://user-images.githubusercontent.com/4405263/219945066-a2adbe64-f75e-4317-bb22-91a8457181fa.png" />
</div>

```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()
```

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