小编avi*_*ght的帖子

C# 中的 ASN.1 编码 BER、PER 等

我一直在搜索这个主题一段时间,没有找到任何相关的答案。所以想把它放在'Stackoverflow'上......

我们正在尝试对字符串进行编码,以便通过 TCP/IP 连接传递它。由于 ASN.1 是最流行的一种,所以我们正在尝试各种规则 BER、DER、PER 等,以找出我们可以使用哪一种。我们的应用程序是一个基于 .net 的应用程序,我正在寻找可以免费使用的库。

奇怪的是我找不到任何免费的库。所以,我开始寻找 .Net 框架本身。我发现只有一个“BERConverter”。所以,我用它做了一个小例子。以字符串为例

string str = "The BER format specifies a self-describing and self-delimiting format for encoding ASN.1 data structures. Each data element is encoded as a type identifier, a length description, the actual data elements, and, where necessary, an end-of-content marker. These types of encodings are commonly called type-length-value or TLV encodings. This format allows a receiver to decode the ASN.1 information from an incomplete stream, without requiring any …
Run Code Online (Sandbox Code Playgroud)

c# encoding asn.1

5
推荐指数
0
解决办法
1万
查看次数

标签 统计

asn.1 ×1

c# ×1

encoding ×1