Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 🏎️
- Host: GitHub
- URL: https://github.com/hazae41/x509
- Owner: hazae41
- Created: 2022-12-02T18:11:14.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-01T16:05:41.000Z (4 months ago)
- Last Synced: 2024-10-07T21:31:10.953Z (3 months ago)
- Topics: asn1, certificate, certificate-authority, decoding, der, encoding, esmodules, javascript, letsencrypt, nodejs, parser, pem, ssl, tls, typescript, unit-testing, x509, zero-copy
- Language: TypeScript
- Homepage:
- Size: 875 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
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()
```