# @oslojs/asn1

> Encode and decode ASN.1 DER

Latest version **1.0.0** (published 2024-09-19) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @oslojs/asn1
pnpm add @oslojs/asn1
yarn add @oslojs/asn1
bun add @oslojs/asn1
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-09-19 |
| First published | 2024-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 54.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | pilcrowOnPaper |
| Maintainers | pilcrowonpaper |
| Keywords | auth, asn1, der |

## Links

- npm: https://www.npmjs.com/package/@oslojs/asn1
- Repository: https://github.com/oslo-project/asn1
- Homepage: https://github.com/oslo-project/asn1#readme
- Issues: https://github.com/oslo-project/asn1/issues
- npm.io page: https://npm.io/package/@oslojs/asn1

## Dependencies (1)

- [@oslojs/binary](https://npm.io/package/@oslojs/binary.md) 1.0.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-09-19
- 0.2.3 — 2024-07-24
- 0.2.2 — 2024-07-05
- 0.2.1 — 2024-07-05
- 0.2.0 — 2024-06-17
- 0.1.3 — 2024-06-08
- 0.1.2 — 2024-06-05
- 0.1.1 — 2024-06-05
- 0.1.0 — 2024-06-04

## README

# @oslojs/asn1

**Documentation: https://asn1.oslojs.dev**

A JavaScript library for encoding and decoding ASN.1 with Distinguished Encoding Rules (DER) by [Oslo](https://oslojs.dev).

- Runtime-agnostic
- No third-party dependencies
- Fully typed

```ts
import { parseASN1NoLeftoverBytes } from "@oslojs/asn1";

const parsed = parseASN1NoLeftoverBytes(encoded);
const oid = parsed.sequence().at(0).objectIdentifier();
if (!oid.is("1.2.840.10045.4.3.2")) {
	throw new Error("Invalid OID");
}
```

> This library only supports DER and not CER or BER.

## Installation

```
npm i @oslojs/asn1
```

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