是否存在用于解析ASN.1或基于ASN.1生成PHP代码的PHP库? [英] Do any PHP libraries exist for parsing ASN.1 or generating PHP code based on it?

查看:320
本文介绍了是否存在用于解析ASN.1或基于ASN.1生成PHP代码的PHP库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过自己了,但是今天我的Google-fu似乎不强.

I've already looked myself but it seems my Google-fu is not strong today.

我正在努力开发一种标准化协议,用于通过Apache/PHP服务器与微控制器上的嵌入式C代码之间的TCP/IP连接交换数据结构.

I'm working to develop a standardized protocol for exchanging data structures over a TCP/IP connection between an Apache / PHP server and embedded C code on a microcontroller.

我们正在使用ASN.1表示法,而我真正想做的是编写一段PHP代码,可以解析ASN.1文档并使用它来解释传入的数据.它将产生一个基于ASN.1适当构造的PHP对象(或数组).这里的目标是使用PHP来解析文档并创建与文档详细信息无关的对象(即,不进行手工编码以匹配文档内容).

We are using ASN.1 notation, and what I would really like to do is to have a piece of PHP code that can parse the ASN.1 document and use it to interpret incoming data. It would produce a PHP object (or array) that is structured appropriately based on the ASN.1. The goal here would be for the PHP that parses the document and creates the objects to be agnostic of the document specifics (i.e. not hand-coded to match the document contents).

或者,如果不可能,是否存在某种使我生成简单的PHP数据传输对象类的东西,而每次ASN.1协议文档发生更改,我都可以重新运行该类?从效率角度来看,这实际上可能是更可取的,因为您不必为每个传入请求重新解释ASN.1.

Alternatively, if this is not possible, does something exist that would let me generate simple PHP data transfer object classes that I could re-run each time the ASN.1 protocol document changed? This might actually be preferable from an efficiency perspective, as you wouldn't have to re-interpret the ASN.1 for each incoming request.

谢谢!让我知道是否可以提供其他有助于澄清该问题的说明.

Thanks! Let me know if I can provide any additional clarification that would help to answer this question.

推荐答案

尝试以下方法:它不是一个脚本库,但您可以像一个脚本库一样使用它.

It's not so much a library as a script, but you can use it like one.

这篇关于是否存在用于解析ASN.1或基于ASN.1生成PHP代码的PHP库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆