ASN.1 DER编码隐式序列

发布于 2025-02-09 19:18:48 字数 721 浏览 1 评论 0原文

我正在尝试以Der格式编码下面的ASN.1语法。

BuiltInStandardAttributes ::= SEQUENCE {
    organizational-unit-names [6] IMPLICIT OrganizationalUnitNames OPTIONAL 
    } 
    
OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
                             OF OrganizationalUnitName

OrganizationalUnitName ::= PrintableString (SIZE
                    (1..ub-organizational-unit-name-length))
                

在示例数据中,我有2个printablestring s“ be”和“ pai”,

我尝试了编码,

SEQUENCE (1 elem)
  [6] (2 elem)
    PrintableString be
    PrintableString pai

30 0B A6 09 13 02 62 65 13 03 70 61 69

这是正确的吗?在这里,如何指定内部序列隐式

I am trying to encode the below ASN.1 grammar in DER format.

BuiltInStandardAttributes ::= SEQUENCE {
    organizational-unit-names [6] IMPLICIT OrganizationalUnitNames OPTIONAL 
    } 
    
OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
                             OF OrganizationalUnitName

OrganizationalUnitName ::= PrintableString (SIZE
                    (1..ub-organizational-unit-name-length))
                

In the sample data, I have 2 PrintableStrings "be" and "pai"

I tried the encoding as

SEQUENCE (1 elem)
  [6] (2 elem)
    PrintableString be
    PrintableString pai

30 0B A6 09 13 02 62 65 13 03 70 61 69

Is this correct? Here, how do I specify the inner SEQUENCE is IMPLICIT?

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

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

发布评论

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

评论(1

尽揽少女心 2025-02-16 19:18:48

您可以在 https://asn1.io/pki-pki-pki-检查员

例如,如果

未指定内联暗示

but your schema specifies the AUTOMATIC TAGS in the module definition, your encoding will match the schema. If your module specifies the EXPLICIT TAGS the encoding won't match.

You can test your encoding against your schema at https://asn1.io/PKI-Inspector.

For example, if

the inline IMPLICT is not specified

but your schema specifies the AUTOMATIC TAGS in the module definition, your encoding will match the schema. If your module specifies the EXPLICIT TAGS the encoding won't match.

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