hidasw/asn1 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hidasw/asn1

最新稳定版本:1.0.0

Composer 安装命令:

composer require hidasw/asn1

包简介

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

README 文档

README

Independent Asn.1 Parse & Create

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

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 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

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);

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2025-04-14