PHPackages                             hidasw/asn1 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hidasw/asn1

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hidasw/asn1
===========

PHP library to parse and create ASN.1 structures without dependencies

1.0.0(1y ago)15GPL-3.0PHPPHP &gt;=7.0

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hidasw/PhpASN1)[ Packagist](https://packagist.org/packages/hidasw/asn1)[ RSS](/packages/hidasw-asn1/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Php ASN.1
=========

[](#php-asn1)

Independent Asn.1 Parse &amp; Create

Description
-----------

[](#description)

Php function to parse and create ASN.1 hex form.
base64 form need to decoded then convert to hex.
DER form need to convert to hex.

Usage
-----

[](#usage)

### Parse as array:

[](#parse-as-array)

Parse hex encoded and return as array:

```
include 'asn1.php;
// $hex is hex form such from bin2hex()
$return = asn1::parse($hex);
```

To specify max parsing depth:

```
$maxdepth = 9;
asn1::parse($hex, $maxdepth);
```

### Create:

[](#create)

create sequence:

```
asn1::sequence($hexdata);
```

create set:

```
asn1::set($hexdata);
```

create various structure:

```
asn1::sequence(
              asn::sequence(
                            asn1::integer('2')
                            ).
              asn1::set(
                        asn1::bitstr('00')
                        )
              );
```

Supported tags
--------------

[](#supported-tags)

```
asn1::sequence($hex);
asn1::octet($hex);
asn1::object($hex);
asn1::bitstr($hex);
asn1::printablestr($str);
asn1::integer($int);
asn1::set($hex);
asn1::explicit($explicitNumber, $hex);
asn1::implicit($num="0");
asn1::utctime($time); // ymdHis
asn1::generalizedtime($time); // YmdHis
asn1::utf8str($str);
asn1::ia5str($str);
asn1::visiblestr($str);
asn1::t61str($str);
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance43

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

446d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40340343?v=4)[M Hida](/maintainers/hidasw)[@hidasw](https://github.com/hidasw)

---

Top Contributors

[![hidasw](https://avatars.githubusercontent.com/u/40340343?v=4)](https://github.com/hidasw "hidasw (19 commits)")

### Embed Badge

![Health badge](/badges/hidasw-asn1/health.svg)

```
[![Health](https://phpackages.com/badges/hidasw-asn1/health.svg)](https://phpackages.com/packages/hidasw-asn1)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
