如何在 ASN.1 上工作并在其中实现结构?

发布于 2024-12-26 21:46:29 字数 101 浏览 1 评论 0原文

我想使用 asn.1 实现一些协议,所以我必须在某些头文件中声明结构并标记名称,并将 asn.1 的编码规则实现为函数。 你能给我推荐一些教程或书籍供我参考吗? 我不知道如何为其编写代码。

I want to implement some protocol using asn.1 so what i have to do declare structures and tag there name in some header file and implement asn.1's encoding rule as a function.
Can you suggest me some tutorial or book to refer.
I don't know how to write a code for it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一生独一 2025-01-02 21:46:29

第 2 部分

如果您有 ASN.1 规范,那么最好的选择是获得一个 ASN.1 编译器,它可以读取 ASN.1 规范并生成与 ASN.1 结构相对应的 C、C++、C# 或 Java 代码。有许多商业和免费的 ASN.1 工具可用,并且许多商业 ASN.1 工具提供免费试用。您可以在 http://www 上查看 ASN.1 工具的详细列表.itu.int/ITU-T/asn1/links/index.htm,您还可以在其中找到其他有用的 ASN.1 信息。

使用好的 ASN.1 工具可以使您的开发任务变得非常简单,因为您不必担心使线路上的精确位正确的所有细节。该工具会为您处理这个问题。您可以专注于 C 数据结构或 C++、C# 或 Java 对象,而 ASN.1 工具负责将其与通过线路发送的位字符串相互转换。

如果您没有 ASN.1 规范,最好还是使用良好的 ASN.1 工具来指导您创建 ASN.1 规范。如果您需要创建自己的规范,那么我的第一条消息中的书籍和教程的链接是一个很好的起点。

保罗

Part 2

If you have an ASN.1 specification, your best bet is to get an ASN.1 compiler which reads the ASN.1 specification and generates code in either C, C++, C#, or Java that corresponds to the ASN.1 structures. There are many commercial and free ASN.1 tools available, and many of the comercial ASN.1 tools offer free trials. You can see a good list of ASN.1 Tools at http://www.itu.int/ITU-T/asn1/links/index.htm, where you can also find additional useful ASN.1 information.

Using a good ASN.1 tool makes your development task very simple since you don't have to worry about all of the details of getting the precise bits on the line correct. The tool handles this for you. You concentrate on the C data structure or C++, C# or Java object while the ASN.1 tool handles converting that to and from the strings of bits that get sent across the line.

If you don't have an ASN.1 specification, it is still best to use a good ASN.1 tool to guide you in creating your ASN.1 specification. The books and tutorials whose links are in my first message are a good place to start if you need to create your own specification.

Paul

鹿童谣 2025-01-02 21:46:29

如果您是 ASN.1 的新手,请查看“ASN.1 变得简单”- http://www.oss.com/asn1/resources/asn1-made-simple/introduction.html - 为您提供了 ASN.1 的简​​单介绍。还有一些好书可以免费下载,网址为 http://www.oss.com/asn1/resources/books-whitepapers-pubs/asn1-books.html 为您提供更全面的视图。

该网站不允许我在每条消息中发布两个以上的链接,因此更多信息将在单独的帖子中发布。

If you are new to ASN.1, take a look at "ASN.1 Made Simple" - http://www.oss.com/asn1/resources/asn1-made-simple/introduction.html - which gives you a simple introduction to ASN.1. There are also a couple of good books available as a free download at http://www.oss.com/asn1/resources/books-whitepapers-pubs/asn1-books.html which give you a much more comprehensive view.

This site won't let me post more than two links per message, so more info will follow in a separate post.

晚风撩人 2025-01-02 21:46:29

所以 ASN.1 并不是真正的你编写代码的东西,因为它只是定义各种通信协议(通常是编码、传输等)的标准的名称。

我很惊讶你显然没有关注过

http://en.wikipedia.org/wiki/Asn.1

随着这一切过去基本定义以及提供有关该主题的多种资源,包括一些书籍和 ASN.1 中定义的各种常见编码标准的示例(例如 DER、BER 等)。

这应该可以帮助您入门,因为您还没有真正指出是否有一些特定的内容您正在或真正正在实施的实施关于您遇到的问题的任何其他信息。

So ASN.1 isn't really something you write code for it's just the name of a standard for defining various communications protocols (generally encoding, transmission etc.)

I'm surprised that you obviously haven't had a gander at

http://en.wikipedia.org/wiki/Asn.1

As this goes over basic definitons as well as providing multiple resources on the topic including some books and examples of various common encoding standards defined in ASN.1 (eg DER, BER etc.)

That should get you started as you haven't really indicated if there's some specific implementation you're working on or really anything else about the problem you're having.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文